# Use Python 3.11 base image FROM python:3.11-slim # Set working directory WORKDIR /code # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ python3-opencv \ && rm -rf /var/lib/apt/lists/* # Copy requirements COPY requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy app COPY . . # Expose port (HF expects 7860 or 8080, we map 8000) EXPOSE 7860 # Run FastAPI using uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]