FROM python:3.12.12-slim WORKDIR /app RUN useradd -m -u 1000 user # Install necessary system dependencies for opencv-python RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* RUN pip install --upgrade pip setuptools wheel COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY --chown=user:user . . USER user EXPOSE 7860 CMD ["python", "app.py"]