FROM python:3.10-slim # Bust the cache when you change this number: ARG CACHEBUST=2 # Minimal system libs (glib needed by many wheels; libgl fixes GUI builds if they ever slip in) RUN apt-get update && apt-get install -y --no-install-recommends \ libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 && \ rm -rf /var/lib/apt/lists/* WORKDIR /code COPY requirements.txt . # Clean install: upgrade tools, remove any GUI OpenCV if cached, then install headless deps RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ pip uninstall -y opencv-python opencv-contrib-python || true && \ pip install --no-cache-dir -r requirements.txt COPY app ./app RUN mkdir -p /code/app/static/processed ENV PORT=7860 CMD ["bash","-lc","python -m uvicorn app.main:app --host 0.0.0.0 --port $PORT"]