Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +3 -7
Dockerfile
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
-
# ---- Base image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# ---- Env
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 6 |
PYTHONUNBUFFERED=1 \
|
| 7 |
HF_HOME=/root/.cache/huggingface \
|
|
@@ -11,17 +9,16 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
| 11 |
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
-
#
|
| 15 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 16 |
-
git git-lfs \
|
| 17 |
&& rm -rf /var/lib/apt/lists/* \
|
| 18 |
&& git lfs install
|
| 19 |
|
| 20 |
-
# ---- Python deps
|
| 21 |
COPY requirements.txt .
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
-
#
|
| 25 |
RUN python - <<'PY'
|
| 26 |
import nltk
|
| 27 |
nltk.download('punkt'); nltk.download('averaged_perceptron_tagger')
|
|
@@ -31,7 +28,6 @@ BlipForConditionalGeneration.from_pretrained('Salesforce/blip-image-captioning-b
|
|
| 31 |
print("Models ready")
|
| 32 |
PY
|
| 33 |
|
| 34 |
-
# ---- App code
|
| 35 |
COPY . .
|
| 36 |
RUN mkdir -p /app/data
|
| 37 |
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
| 3 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 4 |
PYTHONUNBUFFERED=1 \
|
| 5 |
HF_HOME=/root/.cache/huggingface \
|
|
|
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# OS deps (no libgl1-mesa-glx on Debian trixie)
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
+
git git-lfs ffmpeg libsm6 libxext6 libgl1 cmake rsync \
|
| 15 |
&& rm -rf /var/lib/apt/lists/* \
|
| 16 |
&& git lfs install
|
| 17 |
|
|
|
|
| 18 |
COPY requirements.txt .
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
+
# Warm caches so first request is fast
|
| 22 |
RUN python - <<'PY'
|
| 23 |
import nltk
|
| 24 |
nltk.download('punkt'); nltk.download('averaged_perceptron_tagger')
|
|
|
|
| 28 |
print("Models ready")
|
| 29 |
PY
|
| 30 |
|
|
|
|
| 31 |
COPY . .
|
| 32 |
RUN mkdir -p /app/data
|
| 33 |
|