Spaces:
Build error
Build error
| FROM python:3.10-slim | |
| # Install system dependencies required for dlib and OpenCV | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| libopenblas-dev \ | |
| liblapack-dev \ | |
| libx11-dev \ | |
| libgtk-3-dev \ | |
| python3-dev \ | |
| libboost-all-dev \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| libgomp1 \ | |
| pkg-config \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements file | |
| COPY requirements.txt . | |
| # Upgrade pip and install build tools | |
| RUN pip install --no-cache-dir --upgrade pip wheel setuptools | |
| # CRITICAL: Install cmake Python module first | |
| RUN pip install --no-cache-dir cmake | |
| # Set environment variable to disable GUI support for dlib | |
| ENV DLIB_NO_GUI_SUPPORT=1 | |
| # Install dlib (builds from source) | |
| RUN pip install --no-cache-dir dlib | |
| # Install remaining Python packages | |
| RUN pip install --no-cache-dir \ | |
| fastapi==0.104.1 \ | |
| uvicorn[standard]==0.24.0 \ | |
| numpy==1.24.3 \ | |
| opencv-python-headless==4.8.1.78 \ | |
| mediapipe==0.10.7 \ | |
| joblib==1.3.2 \ | |
| python-multipart==0.0.6 \ | |
| websockets==11.0.2 \ | |
| Pillow==10.0.1 \ | |
| scikit-learn==1.3.0 \ | |
| imutils==0.5.4 | |
| # Copy application code | |
| COPY . . | |
| # Expose port | |
| EXPOSE 8000 | |
| # Run the application | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |