Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -12
Dockerfile
CHANGED
|
@@ -1,29 +1,30 @@
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
-
# 1. Switch to root for
|
| 4 |
USER root
|
| 5 |
|
| 6 |
-
# 2. BUILD TIME
|
| 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.
|
| 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.
|
| 21 |
-
# We use /bin/bash to run our setup script every time the container starts.
|
| 22 |
ENTRYPOINT ["/bin/bash", "-c"]
|
| 23 |
|
| 24 |
-
# 6.
|
| 25 |
-
#
|
| 26 |
-
#
|
| 27 |
-
#
|
| 28 |
-
#
|
| 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"]
|