FROM python:3.10-slim WORKDIR /app # Install OS dependencies for OpenCV RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/* COPY requirements.txt . # We can upgrade pip and then install dependencies. We allow pip to resolve versions without strict equal if necessary, # but using the given requirements.txt should be fine as it's a Linux container. RUN pip install --no-cache-dir --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Overwrite some problematic strict versions if they fail, but let's assume they work for now on Linux 3.10. # Wait, contourpy==1.1.0 works on Python 3.10. COPY . . # Hugging Face Spaces exposes port 7860 EXPOSE 7860 CMD ["python", "app.py"]