File size: 548 Bytes
e27037f
 
833f35a
e27037f
833f35a
 
e27037f
 
833f35a
e27037f
833f35a
 
e27037f
833f35a
 
e27037f
833f35a
 
 
e27037f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Use a modern Python base
FROM python:3.10-slim

# Set working directory
WORKDIR /app

# Copy dependency list first (cache layer)
COPY requirements.txt ./

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Expose the default port
ENV PORT=7860
EXPOSE 7860

# Use gunicorn for production; keep one worker with threads (adjust workers for your need)
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "4", "--timeout", "60", "--worker-class", "gthread", "app:app"]