Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +8 -10
Dockerfile
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
WORKDIR /app
|
| 4 |
-
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
ENV TZ=UTC
|
| 7 |
ENV FORCE_CUDA=0
|
|
@@ -15,7 +13,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 15 |
python3-dev build-essential \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
#
|
| 19 |
RUN pip install --no-cache-dir "numpy<2"
|
| 20 |
|
| 21 |
RUN pip install --no-cache-dir \
|
|
@@ -27,13 +25,14 @@ RUN pip install --no-cache-dir \
|
|
| 27 |
'git+https://github.com/facebookresearch/detectron2.git' \
|
| 28 |
--no-build-isolation
|
| 29 |
|
| 30 |
-
#
|
|
|
|
| 31 |
RUN pip install --no-cache-dir \
|
| 32 |
-
"gradio=
|
| 33 |
-
"
|
| 34 |
-
"huggingface_hub==0.19.4" \
|
| 35 |
"opencv-python-headless" \
|
| 36 |
-
"Pillow>=9.0,<12.0"
|
|
|
|
| 37 |
|
| 38 |
# Force numpy back to <2 in case any step above upgraded it
|
| 39 |
RUN pip install --no-cache-dir "numpy<2" --force-reinstall
|
|
@@ -43,9 +42,8 @@ RUN mkdir -p /app/hf_cache && \
|
|
| 43 |
chown -R user:user /app
|
| 44 |
|
| 45 |
USER user
|
| 46 |
-
|
| 47 |
COPY --chown=user . /app
|
| 48 |
-
|
| 49 |
EXPOSE 7860
|
| 50 |
|
|
|
|
| 51 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
|
|
|
| 2 |
WORKDIR /app
|
|
|
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
ENV TZ=UTC
|
| 5 |
ENV FORCE_CUDA=0
|
|
|
|
| 13 |
python3-dev build-essential \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Pin numpy<2 before anything else
|
| 17 |
RUN pip install --no-cache-dir "numpy<2"
|
| 18 |
|
| 19 |
RUN pip install --no-cache-dir \
|
|
|
|
| 25 |
'git+https://github.com/facebookresearch/detectron2.git' \
|
| 26 |
--no-build-isolation
|
| 27 |
|
| 28 |
+
# Upgrade Gradio to 4.x to fix the Jinja2 unhashable dict bug
|
| 29 |
+
# Pin Jinja2 explicitly to avoid future breakage
|
| 30 |
RUN pip install --no-cache-dir \
|
| 31 |
+
"gradio>=4.44.1" \
|
| 32 |
+
"huggingface_hub>=0.19.4" \
|
|
|
|
| 33 |
"opencv-python-headless" \
|
| 34 |
+
"Pillow>=9.0,<12.0" \
|
| 35 |
+
"jinja2>=3.1.2,<4.0"
|
| 36 |
|
| 37 |
# Force numpy back to <2 in case any step above upgraded it
|
| 38 |
RUN pip install --no-cache-dir "numpy<2" --force-reinstall
|
|
|
|
| 42 |
chown -R user:user /app
|
| 43 |
|
| 44 |
USER user
|
|
|
|
| 45 |
COPY --chown=user . /app
|
|
|
|
| 46 |
EXPOSE 7860
|
| 47 |
|
| 48 |
+
# Fix: use the actual filename, not a markdown hyperlink
|
| 49 |
CMD ["python", "app.py"]
|