Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -15
Dockerfile
CHANGED
|
@@ -1,27 +1,22 @@
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
-
# 1. Switch to root
|
| 4 |
USER root
|
| 5 |
|
| 6 |
-
# 2.
|
| 7 |
-
RUN mkdir -p /data/storage /collector/hotdir && \
|
| 8 |
-
chmod -R 777 /data /collector
|
| 9 |
-
|
| 10 |
-
# 3. Set Environment Variables
|
| 11 |
ENV SERVER_PORT=7860
|
| 12 |
ENV STORAGE_DIR="/data/storage"
|
| 13 |
ENV DATABASE_URL="file:/data/storage/anythingllm.db"
|
| 14 |
|
| 15 |
-
#
|
| 16 |
EXPOSE 7860
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
# This tells Docker: "Don't look for a script file. Just run this bash command."
|
| 20 |
ENTRYPOINT ["/bin/bash", "-c"]
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
# -
|
| 24 |
-
# -
|
| 25 |
-
# -
|
| 26 |
-
# - Start the app
|
| 27 |
-
CMD ["mkdir -p /data/storage /collector/hotdir && chmod -R 777 /data /collector && rm -rf /app/server/storage && ln -s /data/storage /app/server/storage && echo 'Permissions fixed. Starting App...' && exec /usr/local/bin/docker-entrypoint.sh composer start"]
|
|
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
+
# 1. Switch to root and STAY root.
|
| 4 |
USER root
|
| 5 |
|
| 6 |
+
# 2. Set Environment Variables
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
ENV SERVER_PORT=7860
|
| 8 |
ENV STORAGE_DIR="/data/storage"
|
| 9 |
ENV DATABASE_URL="file:/data/storage/anythingllm.db"
|
| 10 |
|
| 11 |
+
# 3. Expose the port
|
| 12 |
EXPOSE 7860
|
| 13 |
|
| 14 |
+
# 4. ENTRYPOINT: Use bash to run our custom logic
|
|
|
|
| 15 |
ENTRYPOINT ["/bin/bash", "-c"]
|
| 16 |
|
| 17 |
+
# 5. CMD: The Surgical Fix
|
| 18 |
+
# - mkdir -p: Creates the subfolders (Safe)
|
| 19 |
+
# - chmod 777: Apply ONLY to the subfolders (/data/storage), NOT the root (/data)
|
| 20 |
+
# - Symlink: Redirects internal storage to persistent storage
|
| 21 |
+
# - Start: Runs the app
|
| 22 |
+
CMD ["mkdir -p /data/storage /collector/hotdir && chmod -R 777 /data/storage /collector/hotdir && rm -rf /app/server/storage && ln -s /data/storage /app/server/storage && echo 'Permissions fixed. Starting App...' && exec /usr/local/bin/docker-entrypoint.sh composer start"]
|