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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -13
Dockerfile CHANGED
@@ -1,29 +1,34 @@
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
24
  EXPOSE 7860
25
 
26
- # Switch back to the non-root user for security
27
  USER 1000
28
 
29
  # Start the application
 
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
+ # Switch to root to fix permissions
4
  USER root
5
 
6
+ # 1. Create the persistent directory in Hugging Face's /data volume
7
+ # 2. Assign ownership to user 1000 (which AnythingLLM uses)
8
+ # 3. Ensure permissions are open enough for the container user
9
  RUN mkdir -p /data/storage && \
10
+ chown -R 1000:1000 /data && \
11
  chmod -R 777 /data
12
 
13
+ # Set the port
 
 
 
 
 
 
14
  ENV SERVER_PORT=7860
15
 
16
+ # --- FIX START ---
17
+
18
+ # Tell AnythingLLM to store documents and vectors directly in the persistent drive
19
+ ENV STORAGE_DIR="/data/storage"
20
+
21
+ # CRITICAL FIX: Override the default relative database path.
22
+ # By default, Prisma looks for "file:../storage/anythingllm.db".
23
+ # We set it to the absolute path so it doesn't try to create directories in /app/server.
24
+ ENV DATABASE_URL="file:/data/storage/anythingllm.db"
25
+
26
+ # --- FIX END ---
27
 
28
  # Expose the port Hugging Face expects
29
  EXPOSE 7860
30
 
31
+ # Switch back to the non-root user
32
  USER 1000
33
 
34
  # Start the application