# Use official slim Python image FROM python:3.11-slim ENV PYTHONUNBUFFERED=1 WORKDIR /app # Install system deps required by opencv & dependencies on Debian 12 (trixie) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install COPY requirements.txt /app/requirements.txt RUN pip install --upgrade pip RUN pip install -r /app/requirements.txt # Copy app code COPY . /app # Ensure logs directory exists RUN mkdir -p /app/logs EXPOSE 5000 # Run with gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "1", "--threads", "4", "app:app"]