File size: 451 Bytes
34a7ef1
e5f5db0
 
 
34a7ef1
 
e5f5db0
 
34a7ef1
 
e5f5db0
34a7ef1
 
 
e5f5db0
 
 
34a7ef1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM python:3.11-slim

WORKDIR /app

# Install dependencies first (layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# HuggingFace Spaces runs as a non-root user
RUN useradd -m appuser && chown -R appuser /app
USER appuser

EXPOSE 7860

CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--threads", "4", "--worker-class", "gthread", "--timeout", "180", "app:app"]