# Use official Python slim image FROM python:3.10-slim # Set working directory WORKDIR /app # Copy requirements and install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Clear pip cache to avoid conflicts RUN pip cache purge # Copy application files COPY app.py . COPY templates/ templates/ # Expose port 7860 EXPOSE 7860 # Run with Gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "8", "app:app"]