sam-fritz commited on
Commit
e6a7869
·
verified ·
1 Parent(s): d5d6afa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -15
Dockerfile CHANGED
@@ -1,27 +1,22 @@
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
- # 1. Switch to root for full control
4
  USER root
5
 
6
- # 2. Pre-create directories just to be safe (permissions fixed at runtime below)
7
- RUN mkdir -p /data/storage /collector/hotdir && \
8
- chmod -R 777 /data /collector
9
-
10
- # 3. Set Environment Variables
11
  ENV SERVER_PORT=7860
12
  ENV STORAGE_DIR="/data/storage"
13
  ENV DATABASE_URL="file:/data/storage/anythingllm.db"
14
 
15
- # 4. Expose the port
16
  EXPOSE 7860
17
 
18
- # 5. THE FIX: Override ENTRYPOINT to use bash directly
19
- # This tells Docker: "Don't look for a script file. Just run this bash command."
20
  ENTRYPOINT ["/bin/bash", "-c"]
21
 
22
- # 6. The Startup Command (Chained together)
23
- # - Create/Fix folders on the persistent drive
24
- # - Force permissions (777)
25
- # - Link the internal storage folder to the persistent drive (Symlink)
26
- # - Start the app
27
- CMD ["mkdir -p /data/storage /collector/hotdir && chmod -R 777 /data /collector && rm -rf /app/server/storage && ln -s /data/storage /app/server/storage && echo 'Permissions fixed. Starting App...' && exec /usr/local/bin/docker-entrypoint.sh composer start"]
 
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
+ # 1. Switch to root and STAY root.
4
  USER root
5
 
6
+ # 2. Set Environment Variables
 
 
 
 
7
  ENV SERVER_PORT=7860
8
  ENV STORAGE_DIR="/data/storage"
9
  ENV DATABASE_URL="file:/data/storage/anythingllm.db"
10
 
11
+ # 3. Expose the port
12
  EXPOSE 7860
13
 
14
+ # 4. ENTRYPOINT: Use bash to run our custom logic
 
15
  ENTRYPOINT ["/bin/bash", "-c"]
16
 
17
+ # 5. CMD: The Surgical Fix
18
+ # - mkdir -p: Creates the subfolders (Safe)
19
+ # - chmod 777: Apply ONLY to the subfolders (/data/storage), NOT the root (/data)
20
+ # - Symlink: Redirects internal storage to persistent storage
21
+ # - Start: Runs the app
22
+ CMD ["mkdir -p /data/storage /collector/hotdir && chmod -R 777 /data/storage /collector/hotdir && rm -rf /app/server/storage && ln -s /data/storage /app/server/storage && echo 'Permissions fixed. Starting App...' && exec /usr/local/bin/docker-entrypoint.sh composer start"]