| FROM python:3.9-slim | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| EXPOSE 7860 | |
| # START: MAX CONCURRENCY GUNICORN COMMAND | |
| # Increased the number of stable 'gthread' workers to 25. | |
| # This significantly boosts concurrent user capacity while maintaining stability. | |
| CMD ["gunicorn", "--workers", "25", "--worker-class", "gthread", "--bind", "0.0.0.0:7860", "--timeout", "720", "app:app"] | |
| # END: MAX CONCURRENCY COMMAND | |