newman21 commited on
Commit
4cbb650
·
verified ·
1 Parent(s): 3eec902

Update Dockerfile

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