File size: 691 Bytes
22e35aa
 
 
 
 
 
 
 
 
 
 
9227b93
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM python:3.9-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 7860

# --- START: FINAL OPTIMIZED COMMAND FOR ~10 CONCURRENT USERS ON FREE TIER ---
# This configuration uses only 1 worker to minimize RAM usage.
# It assigns 10 threads to that single worker, allowing it to handle
# approximately 10 concurrent requests while staying within the 512MB RAM limit.
# This is the most efficient setup for a high-concurrency goal on a low-memory plan.
CMD ["gunicorn", "--workers", "8", "--worker-class", "gthread", "--threads", "10", "--bind", "0.0.0.0:7860", "--timeout", "720", "app:app"]
# --- END: FINAL OPTIMIZED COMMAND ---