FROM python:3.9 WORKDIR /app # Install system dependencies for OpenCV RUN apt-get update && apt-get install -y --no-install-recommends \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libgomp1 \ libgl1 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install Python packages COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application COPY app.py . # Expose port EXPOSE 7860 # Run the application CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120", "--workers", "1"]