FROM python:3.9-slim WORKDIR /app # Install system dependencies for OpenCV and GLib RUN apt-get update && apt-get install -y --no-install-recommends \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Copy requirements first to leverage Docker cache COPY backend/requirements_web.txt . RUN pip install --no-cache-dir -r requirements_web.txt RUN pip install --no-cache-dir safetensors packaging # Copy the rest of the application # Copy the rest of the application COPY backend/ backend/ COPY model/ model/ # Set working directory to backend WORKDIR /app/backend # Create necessary directories RUN mkdir -p uploads RUN mkdir -p history_uploads # Expose Hugging Face default port EXPOSE 7860 # Run the application CMD ["python", "app.py"]