Spaces:
Build error
Build error
File size: 871 Bytes
9f3b4fe 5ebec09 17a56e0 5ebec09 17a56e0 5ebec09 17a56e0 9f3b4fe 633d1ac 9f3b4fe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
FROM python:3.10-slim
# Add system dependencies for OpenCV, face recognition, and build tools
RUN apt-get update && apt-get install -y \
# OpenCV dependencies
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libgomp1 \
# Build dependencies for dlib
cmake \
build-essential \
libopenblas-dev \
liblapack-dev \
libx11-dev \
libgtk-3-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
# Install non-PyTorch packages first
RUN pip install --no-cache-dir fastapi uvicorn[standard] numpy pillow matplotlib motor opencv-python-headless dlib face_recognition
# Install PyTorch packages from specific index
RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch torchvision
COPY . .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |