MikeRedemtion/Sumatran
0
1# Dockerfile per HuggingFace Spaces - TVProxy con Gunicorn2 3# 1. Usa l'immagine base ufficiale di Python 3.12 slim4FROM python:3.12-slim5 6# 2. Installa git e certificati SSL (per clonare da GitHub e HTTPS)7RUN apt-get update && apt-get install -y \8 git \9 ca-certificates \10 curl \11 && rm -rf /var/lib/apt/lists/*12 13# 3. Imposta la directory di lavoro14WORKDIR /app15 16# 4. Clona il repository da GitHub17RUN git clone https://github.com/nzo66/tvproxy.git .18 19# 5. Aggiorna pip e installa le dipendenze senza cache20RUN pip install --upgrade pip21RUN pip install --no-cache-dir -r requirements.txt22 23# 6. Espone la porta 7860 per HuggingFace Spaces24EXPOSE 786025 26# 7. Comando per avviare Gunicorn ottimizzato per HuggingFace Spaces27# - 2 worker (limite per Spaces gratuiti)28# - Worker class sync (più stabile per proxy HTTP)29# - Timeout adeguati per streaming30# - Logging su stdout/stderr31CMD ["gunicorn", "app:app", \32 "-w", "2", \33 "--worker-class", "sync", \34 "-b", "0.0.0.0:7860", \35 "--timeout", "120", \36 "--keep-alive", "5", \37 "--max-requests", "500", \38 "--max-requests-jitter", "50", \39 "--access-logfile", "-", \40 "--error-logfile", "-", \41 "--log-level", "info"]42 