Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +21 -12
Dockerfile
CHANGED
|
@@ -2,19 +2,28 @@ FROM mintplexlabs/anythingllm:latest
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
-
RUN mkdir -p /
|
| 6 |
-
|
| 7 |
-
chmod -R 777 /app/server/storage /app/local_data
|
| 8 |
-
|
| 9 |
-
ENV STORAGE_DIR=/app/local_data
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
ENV SERVER_PORT=7860
|
|
|
|
| 12 |
EXPOSE 7860
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
+
RUN mkdir -p /collector/hotdir && \
|
| 6 |
+
chmod -R 777 /collector
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
ENV JWT_SECRET="my-random-secret-key-123"
|
| 9 |
+
# Point AnythingLLM's core storage to your persistent SSD volume
|
| 10 |
+
ENV STORAGE_DIR=/data/storage
|
| 11 |
ENV SERVER_PORT=7860
|
| 12 |
+
|
| 13 |
EXPOSE 7860
|
| 14 |
|
| 15 |
+
ENTRYPOINT ["/bin/bash", "-c"]
|
| 16 |
+
|
| 17 |
+
# 1. Create the persistent and bucket folders
|
| 18 |
+
# 2. Handle the .env file exactly like your old script
|
| 19 |
+
# 3. Symlink ONLY the documents/vector-cache from the SSD to the bucket
|
| 20 |
+
# 4. Boot the app
|
| 21 |
+
CMD ["mkdir -p /data/storage /app/server/storage/documents /app/server/storage/vector-cache && \
|
| 22 |
+
chmod -R 777 /data/storage /app/server/storage && \
|
| 23 |
+
if [ ! -f /data/storage/.env ]; then cp /app/server/.env /data/storage/.env; fi && \
|
| 24 |
+
rm -f /app/server/.env && \
|
| 25 |
+
ln -sf /data/storage/.env /app/server/.env && \
|
| 26 |
+
ln -sfn /app/server/storage/documents /data/storage/documents && \
|
| 27 |
+
ln -sfn /app/server/storage/vector-cache /data/storage/vector-cache && \
|
| 28 |
+
echo 'Storage and .env linked. Starting App...' && \
|
| 29 |
+
exec /usr/local/bin/docker-entrypoint.sh"]
|