Spaces:
Sleeping
Sleeping
File size: 2,149 Bytes
4cbb650 3eec902 4cbb650 3eec902 4cbb650 3eec902 4cbb650 3eec902 4cbb650 3eec902 4cbb650 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | # Fase 1: Build
# Usa un'immagine Python con base Debian per FFmpeg completo
FROM python:3.11-bookworm
# Runtime flags for browser-assisted extractors in containers.
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
ENV PYTHONUNBUFFERED=1
# Installa git, FFmpeg e le dipendenze necessarie a Chromium/Xvfb.
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
xvfb \
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libasound2 \
libpango-1.0-0 \
libcairo2 \
libatspi2.0-0 \
libxshmfence1 \
libglu1-mesa \
ca-certificates \
fonts-liberation \
&& rm -rf /var/lib/apt/lists/*
# Imposta la directory di lavoro all'interno del container.
WORKDIR /app
# CLONA il repository. Questo comando scarica TUTTI i file, incluso requirements.txt.
RUN git clone https://github.com/stremio-manager/EasyProxy .
# Installa le dipendenze Python.
RUN pip install --no-cache-dir -r requirements.txt
# Installa Chromium gestito da Playwright.
RUN python -m playwright install chromium
# Copia il resto del codice dell'applicazione nella directory di lavoro.
# Metadata dell'immagine OCI (Open Container Initiative) corretti.
LABEL org.opencontainers.image.title="HLS Proxy Server"
LABEL org.opencontainers.image.description="Server proxy universale per stream HLS con supporto Vavoo, DLHD e playlist builder"
LABEL org.opencontainers.image.version="2.5.0"
LABEL org.opencontainers.image.source="https://github.com/realbestia1/EasyProxy"
# Esponi la porta su cui l'applicazione è in ascolto.
EXPOSE 7860
# Comando per avviare l'app in produzione con Gunicorn
# Usa sh -c per permettere l'espansione delle variabili e il fallback dinamico dei worker
CMD ["sh", "-c", "WORKERS_COUNT=${WORKERS:-$(nproc 2>/dev/null || echo 1)}; xvfb-run -a --server-args='-screen 0 1366x768x24' gunicorn --bind 0.0.0.0:${PORT:-7860} --workers $WORKERS_COUNT --worker-class aiohttp.worker.GunicornWebWorker --timeout 120 --graceful-timeout 120 app:app"] |