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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -19
Dockerfile CHANGED
@@ -1,34 +1,30 @@
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
 
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
+ # Switch to root to perform setup
4
  USER root
5
 
6
+ # 1. Setup Persistent Storage (Hugging Face /data)
 
 
7
  RUN mkdir -p /data/storage && \
8
+ chmod -R 777 /data && \
9
+ chown -R 1000:1000 /data
10
 
11
+ # 2. FIX: Create the missing 'hotdir' directory explicitly
12
+ # The error shows the app looks for '/collector/hotdir', so we ensure it exists
13
+ # and is writable by the app user.
14
+ RUN mkdir -p /collector/hotdir && \
15
+ chmod -R 777 /collector && \
16
+ chown -R 1000:1000 /collector
17
 
18
+ # 3. Environment Variables
19
+ ENV SERVER_PORT=7860
20
  ENV STORAGE_DIR="/data/storage"
21
+ # Ensure the database is saved to the persistent drive
 
 
 
22
  ENV DATABASE_URL="file:/data/storage/anythingllm.db"
23
 
24
+ # Expose port
 
 
25
  EXPOSE 7860
26
 
27
+ # Switch back to the application user
28
  USER 1000
29
 
30
  # Start the application