Spaces:
Sleeping
Sleeping
change Dockerfile
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -6,21 +6,23 @@ WORKDIR /app
|
|
| 6 |
# Copy dependencies
|
| 7 |
COPY requirements.txt setup.py ./
|
| 8 |
|
| 9 |
-
#
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
| 17 |
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"
|
| 18 |
|
| 19 |
-
#
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
-
#
|
| 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"]
|