Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +5 -9
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
@@ -9,14 +9,12 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
libgl1-mesa-glx libgomp1 \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# STEP 2: detectron2 (torch is now available)
|
| 16 |
RUN pip install --no-cache-dir \
|
| 17 |
-
|
| 18 |
|
| 19 |
-
#
|
| 20 |
RUN pip install --no-cache-dir \
|
| 21 |
gradio==4.44.0 \
|
| 22 |
opencv-python-headless \
|
|
@@ -26,10 +24,8 @@ RUN pip install --no-cache-dir \
|
|
| 26 |
|
| 27 |
COPY app.py .
|
| 28 |
|
| 29 |
-
# Create non-root user (required by HF Spaces)
|
| 30 |
RUN useradd -m -u 1000 user
|
| 31 |
USER user
|
| 32 |
|
| 33 |
EXPOSE 7860
|
| 34 |
-
|
| 35 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 9 |
libgl1-mesa-glx libgomp1 \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Install detectron2 prebuilt wheel (matches torch 2.1.0 + cuda 11.8)
|
| 13 |
+
# This avoids compiling from source entirely
|
|
|
|
|
|
|
| 14 |
RUN pip install --no-cache-dir \
|
| 15 |
+
detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu118/torch2.1/index.html
|
| 16 |
|
| 17 |
+
# Other deps
|
| 18 |
RUN pip install --no-cache-dir \
|
| 19 |
gradio==4.44.0 \
|
| 20 |
opencv-python-headless \
|
|
|
|
| 24 |
|
| 25 |
COPY app.py .
|
| 26 |
|
|
|
|
| 27 |
RUN useradd -m -u 1000 user
|
| 28 |
USER user
|
| 29 |
|
| 30 |
EXPOSE 7860
|
|
|
|
| 31 |
CMD ["python", "app.py"]
|