FROM python:3.10-slim WORKDIR /code # Install system dependencies for OpenCV (including libGL) RUN apt-get update && apt-get install -y \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libgomp1 \ libxcb1 \ libxcb-shm0 \ libxcb-render0 \ libgl1 \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r /code/requirements.txt COPY app.py /code/app.py RUN mkdir -p /tmp/huggingface && chmod 777 /tmp/huggingface EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]