Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +20 -21
Dockerfile
CHANGED
|
@@ -2,28 +2,27 @@ FROM mintplexlabs/anythingllm:latest
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
#
|
| 10 |
-
ENV STORAGE_DIR=/
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
|
|
|
| 13 |
EXPOSE 7860
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
#
|
| 18 |
-
|
| 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"]
|
|
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
+
# Create local folders for EVERYTHING that needs to 'lock'
|
| 6 |
+
RUN mkdir -p /app/server/storage /app/local_data/lancedb /app/local_data/vector-cache && \
|
| 7 |
+
chown -R 1000:1000 /app/server/storage /app/local_data && \
|
| 8 |
+
chmod -R 777 /app/server/storage /app/local_data
|
| 9 |
|
| 10 |
+
# Environment Variables
|
| 11 |
+
# We point the main storage to the bucket for your PDFs
|
| 12 |
+
ENV STORAGE_DIR=/app/server/storage
|
| 13 |
+
|
| 14 |
+
# WE FORCE THE DATABASE AND VECTORS TO STAY LOCAL (Fixes the 'Table not found' error)
|
| 15 |
+
ENV DB_PATH=/app/local_data/anythingllm.db
|
| 16 |
+
ENV VECTOR_DB_PATH=/app/local_data/lancedb
|
| 17 |
+
ENV VECTOR_CACHE_DIR=/app/local_data/vector-cache
|
| 18 |
+
|
| 19 |
+
# Ensure the app uses the local disk for the heavy lifting
|
| 20 |
+
ENV STORAGE_LOCATION=/app/local_data
|
| 21 |
|
| 22 |
+
ENV SERVER_PORT=7860
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
+
USER 1000
|
| 26 |
+
|
| 27 |
+
# Runtime permission fix
|
| 28 |
+
CMD ["/bin/bash", "-c", "chmod -R 777 /app/server/storage && /usr/local/bin/docker-entrypoint.sh"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|