sam-fritz commited on
Commit
6ab73de
·
verified ·
1 Parent(s): 201ac27

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -8
Dockerfile CHANGED
@@ -1,18 +1,23 @@
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
- # Switch to root to fix permissions
4
  USER root
5
 
6
- # Create the storage directory and give the default user (1000) access
7
- # Hugging Face runs as user 1000 by default
8
- RUN mkdir -p /app/server/storage && \
9
- chown -R 1000:1000 /app/server/storage && \
10
- chmod -R 777 /app/server/storage
 
 
 
 
11
 
12
  # Set environment variables
13
- # SERVER_PORT tells AnythingLLM to listen on 7860 (Hugging Face's default port)
14
  ENV SERVER_PORT=7860
15
- # STORAGE_DIR ensures data goes to the writable folder we made
 
 
16
  ENV STORAGE_DIR="/app/server/storage"
17
 
18
  # Expose the port Hugging Face expects
 
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
+ # Switch to root to fix permissions and create links
4
  USER root
5
 
6
+ # Hugging Face mounts the persistent drive at /data. We create a subfolder there.
7
+ RUN mkdir -p /data/storage && \
8
+ chmod -R 777 /data
9
+
10
+ # Instead of just creating the app folder, we delete it and replace it
11
+ # with a link to the persistent drive.
12
+ # Now, when AnythingLLM writes to /app/server/storage, it actually goes to /data/storage.
13
+ RUN rm -rf /app/server/storage && \
14
+ ln -s /data/storage /app/server/storage
15
 
16
  # Set environment variables
 
17
  ENV SERVER_PORT=7860
18
+
19
+ # Since we symlinked this path above, we don't need to change this variable.
20
+ # The app thinks it is writing locally, but the link sends it to the persistent drive.
21
  ENV STORAGE_DIR="/app/server/storage"
22
 
23
  # Expose the port Hugging Face expects