sam-fritz commited on
Commit
88c0471
·
verified ·
1 Parent(s): 17fcf51

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -2,25 +2,28 @@ FROM mintplexlabs/anythingllm:latest
2
 
3
  USER root
4
 
5
- # 1. Create a local folder for Models and Vector DB (Fast SSD)
6
- # 2. Create the bucket mount folder (Persistent Storage)
7
  RUN mkdir -p /app/server/storage /collector/hotdir /app/local_data/models /app/local_data/lancedb && \
8
  chown -R 1000:1000 /app/server/storage /collector/hotdir /app/local_data && \
9
  chmod -R 777 /app/server/storage /collector/hotdir /app/local_data
10
 
11
- # Environment Variables - The "Secret Sauce"
 
 
 
 
 
 
12
  ENV COLLECTOR_HOTDIR=/collector/hotdir
13
  ENV STORAGE_DIR=/app/server/storage
14
-
15
- # FORCE the heavy/locking stuff to live on the Space's local drive, NOT the bucket
16
  ENV VECTOR_DB_PATH=/app/local_data/lancedb
17
  ENV XENOVA_MODEL_DIR=/app/local_data/models
18
- ENV SENTENCE_TRANSFORMERS_HOME=/app/local_data/models
19
 
 
 
20
  ENV SERVER_PORT=7860
21
- EXPOSE 7860
22
 
 
23
  USER 1000
24
 
25
- # Fix permissions on the mount at runtime and start
26
  CMD ["/bin/bash", "-c", "chmod -R 777 /app/server/storage && /usr/local/bin/docker-entrypoint.sh"]
 
2
 
3
  USER root
4
 
5
+ # 1. Create all necessary paths
 
6
  RUN mkdir -p /app/server/storage /collector/hotdir /app/local_data/models /app/local_data/lancedb && \
7
  chown -R 1000:1000 /app/server/storage /collector/hotdir /app/local_data && \
8
  chmod -R 777 /app/server/storage /collector/hotdir /app/local_data
9
 
10
+ # 2. PRE-DOWNLOAD the embedding model so the app doesn't have to "fetch" it
11
+ # This avoids the "Fetch Failed" error entirely
12
+ RUN apt-get update && apt-get install -y curl && \
13
+ mkdir -p /app/local_data/models/Xenova/all-Minilm-L6-v2 && \
14
+ curl -L https://huggingface.co/Xenova/all-MiniLM-L6-v2/resolve/main/onnx/model_optimized.onnx -o /app/local_data/models/Xenova/all-Minilm-L6-v2/model.onnx
15
+
16
+ # Environment Variables
17
  ENV COLLECTOR_HOTDIR=/collector/hotdir
18
  ENV STORAGE_DIR=/app/server/storage
 
 
19
  ENV VECTOR_DB_PATH=/app/local_data/lancedb
20
  ENV XENOVA_MODEL_DIR=/app/local_data/models
 
21
 
22
+ # Speed up the app by skipping the "Check for updates" on models
23
+ ENV SKIP_MODEL_CHECK=true
24
  ENV SERVER_PORT=7860
 
25
 
26
+ EXPOSE 7860
27
  USER 1000
28
 
 
29
  CMD ["/bin/bash", "-c", "chmod -R 777 /app/server/storage && /usr/local/bin/docker-entrypoint.sh"]