Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +0 -6
Dockerfile
CHANGED
|
@@ -2,16 +2,12 @@
|
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# ---- Set cache directories FIRST ----
|
| 5 |
-
# All model downloads will go to /tmp/.cache (writable runtime disk)
|
| 6 |
ENV HF_HOME=/tmp/.cache/huggingface \
|
| 7 |
TRANSFORMERS_CACHE=/tmp/.cache/huggingface \
|
| 8 |
SENTENCE_TRANSFORMERS_HOME=/tmp/.cache/sentence-transformers \
|
| 9 |
SPACY_DATA=/tmp/.cache/spacy \
|
| 10 |
NLTK_DATA=/tmp/.cache/nltk
|
| 11 |
|
| 12 |
-
# ---- Install system dependencies (if any) ----
|
| 13 |
-
# (none required for this project, but keep if needed)
|
| 14 |
-
|
| 15 |
# ---- Set working directory ----
|
| 16 |
WORKDIR /app
|
| 17 |
|
|
@@ -19,7 +15,6 @@ WORKDIR /app
|
|
| 19 |
COPY requirements.txt .
|
| 20 |
|
| 21 |
# ---- Install Python dependencies ----
|
| 22 |
-
# This does NOT download any models (spacy model is NOT downloaded here)
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
# ---- Copy the rest of the application ----
|
|
@@ -29,5 +24,4 @@ COPY . .
|
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
# ---- Start the FastAPI server ----
|
| 32 |
-
# Models will be downloaded automatically on first request to /tmp/.cache
|
| 33 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# ---- Set cache directories FIRST ----
|
|
|
|
| 5 |
ENV HF_HOME=/tmp/.cache/huggingface \
|
| 6 |
TRANSFORMERS_CACHE=/tmp/.cache/huggingface \
|
| 7 |
SENTENCE_TRANSFORMERS_HOME=/tmp/.cache/sentence-transformers \
|
| 8 |
SPACY_DATA=/tmp/.cache/spacy \
|
| 9 |
NLTK_DATA=/tmp/.cache/nltk
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
# ---- Set working directory ----
|
| 12 |
WORKDIR /app
|
| 13 |
|
|
|
|
| 15 |
COPY requirements.txt .
|
| 16 |
|
| 17 |
# ---- Install Python dependencies ----
|
|
|
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
# ---- Copy the rest of the application ----
|
|
|
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
# ---- Start the FastAPI server ----
|
|
|
|
| 27 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|