forked from realbestia1/EasyProxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (52 loc) · 2 KB
/
Dockerfile
File metadata and controls
62 lines (52 loc) · 2 KB
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
62
# Fase 1: Build
# Usa un'immagine Python con base Debian per FFmpeg completo
FROM python:3.11-bookworm
# Imposta la directory di lavoro all'interno del container.
WORKDIR /app
# Copia il file delle dipendenze.
# Farlo prima del resto del codice sfrutta la cache di Docker se le dipendenze non cambiano.
COPY requirements.txt .
# Runtime flags for browser-assisted extractors in containers.
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
ENV PYTHONUNBUFFERED=1
# Installa FFmpeg e le dipendenze necessarie a Chromium/Xvfb.
RUN apt-get update && apt-get install -y \
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/*
# 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.
COPY . .
# 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 della variabile d'ambiente $PORT
CMD sh -c "xvfb-run -a --server-args='-screen 0 1366x768x24' gunicorn --bind 0.0.0.0:${PORT:-7860} --workers 2 --worker-class aiohttp.worker.GunicornWebWorker --timeout 120 --graceful-timeout 120 app:app"