Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -8
Dockerfile
CHANGED
|
@@ -1,18 +1,23 @@
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
-
# Switch to root to fix permissions
|
| 4 |
USER root
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Set environment variables
|
| 13 |
-
# SERVER_PORT tells AnythingLLM to listen on 7860 (Hugging Face's default port)
|
| 14 |
ENV SERVER_PORT=7860
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
ENV STORAGE_DIR="/app/server/storage"
|
| 17 |
|
| 18 |
# Expose the port Hugging Face expects
|
|
|
|
| 1 |
FROM mintplexlabs/anythingllm:latest
|
| 2 |
|
| 3 |
+
# Switch to root to fix permissions and create links
|
| 4 |
USER root
|
| 5 |
|
| 6 |
+
# Hugging Face mounts the persistent drive at /data. We create a subfolder there.
|
| 7 |
+
RUN mkdir -p /data/storage && \
|
| 8 |
+
chmod -R 777 /data
|
| 9 |
+
|
| 10 |
+
# Instead of just creating the app folder, we delete it and replace it
|
| 11 |
+
# with a link to the persistent drive.
|
| 12 |
+
# Now, when AnythingLLM writes to /app/server/storage, it actually goes to /data/storage.
|
| 13 |
+
RUN rm -rf /app/server/storage && \
|
| 14 |
+
ln -s /data/storage /app/server/storage
|
| 15 |
|
| 16 |
# Set environment variables
|
|
|
|
| 17 |
ENV SERVER_PORT=7860
|
| 18 |
+
|
| 19 |
+
# Since we symlinked this path above, we don't need to change this variable.
|
| 20 |
+
# The app thinks it is writing locally, but the link sends it to the persistent drive.
|
| 21 |
ENV STORAGE_DIR="/app/server/storage"
|
| 22 |
|
| 23 |
# Expose the port Hugging Face expects
|