FROM python:3.10-slim # Avoid buffering issues ENV PYTHONUNBUFFERED=1 # Install system dependencies RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy files COPY . /app # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Expose port (HuggingFace uses 7860) EXPOSE 7860 # Run using gunicorn (production) CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]