tmt3103 commited on
Commit
26e329e
·
1 Parent(s): 5a5f157

change Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -6,21 +6,23 @@ WORKDIR /app
6
  # Copy dependencies
7
  COPY requirements.txt setup.py ./
8
 
9
- # dependencies
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- #
13
- ENV TRANSFORMERS_CACHE=/app/.cache
14
  ENV HF_HOME=/app/.cache
15
 
16
- # Pre-download HuggingFace model
 
 
 
17
  RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"
18
 
19
- # Copy source code
20
  COPY . .
21
 
22
- # Expose port
23
  EXPOSE 7860
24
 
25
- # Run app
26
  CMD ["python", "app.py"]
 
6
  # Copy dependencies
7
  COPY requirements.txt setup.py ./
8
 
9
+ # dependencies
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ # cache directory for Hugging Face
 
13
  ENV HF_HOME=/app/.cache
14
 
15
+ #
16
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
17
+
18
+ # Pre-download model (sentence-transformers/all-MiniLM-L6-v2)
19
  RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"
20
 
21
+ #
22
  COPY . .
23
 
24
+ #
25
  EXPOSE 7860
26
 
27
+ # Run app
28
  CMD ["python", "app.py"]