Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +19 -17
Dockerfile
CHANGED
|
@@ -1,30 +1,32 @@
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
-
# 1. Switch to root
|
| 4 |
USER root
|
| 5 |
|
| 6 |
-
# 2. BUILD TIME: Create the
|
|
|
|
| 7 |
RUN mkdir -p /collector/hotdir && \
|
| 8 |
chmod -R 777 /collector
|
| 9 |
|
| 10 |
-
# 3.
|
| 11 |
-
|
| 12 |
-
ENV
|
| 13 |
-
ENV DATABASE_URL="file:/data/storage/anythingllm.db"
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
#
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
-
#
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
#
|
| 23 |
ENTRYPOINT ["/bin/bash", "-c"]
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
# -
|
| 27 |
-
# -
|
| 28 |
-
# -
|
| 29 |
-
# -
|
| 30 |
-
|
|
|
|
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
+
# 1. Switch to root to handle permissions and folder creation
|
| 4 |
USER root
|
| 5 |
|
| 6 |
+
# 2. BUILD TIME: Create the "hot directory" for uploads
|
| 7 |
+
# We do this now so the folder definitely exists with open permissions.
|
| 8 |
RUN mkdir -p /collector/hotdir && \
|
| 9 |
chmod -R 777 /collector
|
| 10 |
|
| 11 |
+
# 3. CRITICAL FIX: Add the JWT Secret
|
| 12 |
+
# The app needs this to sign login tokens. Without it, uploads often fail.
|
| 13 |
+
ENV JWT_SECRET="my-random-secret-key-123"
|
|
|
|
| 14 |
|
| 15 |
+
# 4. ENVIRONMENT: Revert to Defaults!
|
| 16 |
+
# We do NOT set DATABASE_URL or STORAGE_DIR here.
|
| 17 |
+
# We let the app use its default internal paths, which we will redirect below.
|
| 18 |
+
ENV SERVER_PORT=7860
|
| 19 |
|
| 20 |
+
# 5. Expose the port
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
+
# 6. ENTRYPOINT: Use bash to run our custom setup
|
| 24 |
ENTRYPOINT ["/bin/bash", "-c"]
|
| 25 |
|
| 26 |
+
# 7. STARTUP COMMAND: The "Magic Link" Strategy
|
| 27 |
+
# - mkdir -p /data/storage: Create the physical folder on the hard drive.
|
| 28 |
+
# - chmod 777: Make it writable.
|
| 29 |
+
# - rm -rf /app/server/storage: Delete the app's internal "fake" storage.
|
| 30 |
+
# - ln -s ...: Replace it with a link to the hard drive.
|
| 31 |
+
# - start: Run the app.
|
| 32 |
+
CMD ["mkdir -p /data/storage && chmod -R 777 /data/storage && rm -rf /app/server/storage && ln -s /data/storage /app/server/storage && echo 'Storage linked. Starting App...' && exec /usr/local/bin/docker-entrypoint.sh composer start"]
|