File size: 587 Bytes
7e26453
 
4cc5a4d
7e26453
 
 
 
 
 
 
 
 
d217056
7e26453
728e11d
7e26453
 
728e11d
7e26453
728e11d
 
7e26453
728e11d
d89b9ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.9-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

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

COPY . .

# Create necessary directories
RUN mkdir -p /app/images /app/videos

# Environment variables
ENV PYTHONUNBUFFERED=1
ENV FLASK_ENV=production
ENV FLASK_APP=app.py

# Use gthread worker for better performance
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--worker-class", "gthread", "--workers", "1", "--threads", "4", "--timeout", "0", "app:app"]