Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -10
Dockerfile
CHANGED
|
@@ -1,22 +1,29 @@
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
-
# 1. Switch to root
|
| 4 |
USER root
|
| 5 |
|
| 6 |
-
# 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
ENV SERVER_PORT=7860
|
| 8 |
ENV STORAGE_DIR="/data/storage"
|
| 9 |
ENV DATABASE_URL="file:/data/storage/anythingllm.db"
|
| 10 |
|
| 11 |
-
#
|
| 12 |
EXPOSE 7860
|
| 13 |
|
| 14 |
-
#
|
|
|
|
| 15 |
ENTRYPOINT ["/bin/bash", "-c"]
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
#
|
| 19 |
-
#
|
| 20 |
-
# -
|
| 21 |
-
#
|
| 22 |
-
CMD ["mkdir -p /data/storage
|
|
|
|
| 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"]
|