sam-fritz commited on
Commit
2994735
·
verified ·
1 Parent(s): b4974f1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -12
Dockerfile CHANGED
@@ -1,29 +1,30 @@
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
- # 1. Switch to root for the build phase
4
  USER root
5
 
6
- # 2. BUILD TIME ACTION: Create the collector directory NOW.
7
- # We do this here because we have full root access to the image filesystem during build.
8
- # We also open the permissions immediately.
9
  RUN mkdir -p /collector/hotdir && \
10
  chmod -R 777 /collector
11
 
12
- # 3. Set Environment Variables
13
  ENV SERVER_PORT=7860
14
  ENV STORAGE_DIR="/data/storage"
15
  ENV DATABASE_URL="file:/data/storage/anythingllm.db"
16
 
 
 
 
 
17
  # 4. Expose the port
18
  EXPOSE 7860
19
 
20
- # 5. RUNTIME ACTION: The Entrypoint Override
21
- # We use /bin/bash to run our setup script every time the container starts.
22
  ENTRYPOINT ["/bin/bash", "-c"]
23
 
24
- # 6. The Command Sequence
25
- # A. mkdir -p /data/storage: Create the folder on the persistent drive.
26
- # B. chmod -R 777 /data/storage: Ensure the persistent folder is writable.
27
- # C. rm -rf ... && ln -s ...: Link the app's internal storage to the persistent drive.
28
- # D. exec ...: Start the actual application.
29
  CMD ["mkdir -p /data/storage && chmod -R 777 /data/storage && rm -rf /app/server/storage && ln -s /data/storage /app/server/storage && echo 'Starting AnythingLLM...' && exec /usr/local/bin/docker-entrypoint.sh composer start"]
 
1
  FROM mintplexlabs/anythingllm:latest
2
 
3
+ # 1. Switch to root for build-time operations
4
  USER root
5
 
6
+ # 2. BUILD TIME: Create the collector directory and open permissions
 
 
7
  RUN mkdir -p /collector/hotdir && \
8
  chmod -R 777 /collector
9
 
10
+ # 3. Environment Variables
11
  ENV SERVER_PORT=7860
12
  ENV STORAGE_DIR="/data/storage"
13
  ENV DATABASE_URL="file:/data/storage/anythingllm.db"
14
 
15
+ # FIX: Add a secret key for user sessions (Required for login/auth to work)
16
+ # You can change "my-super-secret-jwt-key" to any random string you want.
17
+ ENV JWT_SECRET="n0CGf5vAfq3pF4udl25BYCmp903QEo"
18
+
19
  # 4. Expose the port
20
  EXPOSE 7860
21
 
22
+ # 5. Runtime Entrypoint
 
23
  ENTRYPOINT ["/bin/bash", "-c"]
24
 
25
+ # 6. Runtime Command
26
+ # - Creates persistent folders
27
+ # - Sets permissions on persistent folders
28
+ # - Links internal storage to persistent storage
29
+ # - Starts the app
30
  CMD ["mkdir -p /data/storage && chmod -R 777 /data/storage && rm -rf /app/server/storage && ln -s /data/storage /app/server/storage && echo 'Starting AnythingLLM...' && exec /usr/local/bin/docker-entrypoint.sh composer start"]