Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +14 -4
Dockerfile
CHANGED
|
@@ -2,18 +2,22 @@ FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
|
|
| 7 |
libgl1 \
|
|
|
|
|
|
|
| 8 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
# Create
|
| 11 |
RUN mkdir -p uploaded_images static models uploaded_videos
|
| 12 |
|
| 13 |
-
#
|
| 14 |
RUN pip install --no-cache-dir "numpy<1.25"
|
| 15 |
|
| 16 |
-
#
|
| 17 |
RUN pip install --no-cache-dir \
|
| 18 |
opencv-python-headless==4.7.0.72 \
|
| 19 |
fastapi==0.95.0 \
|
|
@@ -24,3 +28,9 @@ RUN pip install --no-cache-dir \
|
|
| 24 |
face_recognition==1.3.0 \
|
| 25 |
torchvision==0.14.1 \
|
| 26 |
Pillow==9.4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Add system-level dependencies for dlib and OpenCV
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
+
cmake \
|
| 8 |
+
build-essential \
|
| 9 |
libgl1 \
|
| 10 |
+
libboost-all-dev \
|
| 11 |
+
python3-dev \
|
| 12 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Create app directories
|
| 15 |
RUN mkdir -p uploaded_images static models uploaded_videos
|
| 16 |
|
| 17 |
+
# Install numpy first to avoid cv2/numpy conflict
|
| 18 |
RUN pip install --no-cache-dir "numpy<1.25"
|
| 19 |
|
| 20 |
+
# Install Python dependencies
|
| 21 |
RUN pip install --no-cache-dir \
|
| 22 |
opencv-python-headless==4.7.0.72 \
|
| 23 |
fastapi==0.95.0 \
|
|
|
|
| 28 |
face_recognition==1.3.0 \
|
| 29 |
torchvision==0.14.1 \
|
| 30 |
Pillow==9.4.0
|
| 31 |
+
|
| 32 |
+
COPY app.py .
|
| 33 |
+
|
| 34 |
+
EXPOSE 7860
|
| 35 |
+
|
| 36 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|