FROM python:3.10-slim WORKDIR /app # Install system dependencies for OpenCV RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create output directory RUN mkdir -p output # Expose the port Hugging Face expects EXPOSE 7860 # Run the application CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "api_server:app"]