Create Dockerfile
Browse files- Dockerfile +84 -0
Dockerfile
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Monolithic Dockerfile for HuggingFace Spaces / VPS (Multi-Arch)
|
| 2 |
+
# Includes FlareSolverr v3 (Python) and Byparr (Patched for compatibility)
|
| 3 |
+
|
| 4 |
+
FROM python:3.12-bookworm
|
| 5 |
+
|
| 6 |
+
# 1. Environment Settings
|
| 7 |
+
WORKDIR /app
|
| 8 |
+
ENV PYTHONUNBUFFERED=1
|
| 9 |
+
ENV FLARESOLVERR_URL=http://localhost:8191
|
| 10 |
+
ENV BYPARR_URL=http://localhost:8192
|
| 11 |
+
ENV BYPARR_PORT=8192
|
| 12 |
+
ENV PORT=7860
|
| 13 |
+
|
| 14 |
+
# 2. System Dependencies
|
| 15 |
+
RUN apt-get update && apt-get install -y \
|
| 16 |
+
curl \
|
| 17 |
+
git \
|
| 18 |
+
ffmpeg \
|
| 19 |
+
xvfb \
|
| 20 |
+
chromium \
|
| 21 |
+
libnss3 \
|
| 22 |
+
libatk1.0-0 \
|
| 23 |
+
libatk-bridge2.0-0 \
|
| 24 |
+
libcups2 \
|
| 25 |
+
libdrm2 \
|
| 26 |
+
libxkbcommon0 \
|
| 27 |
+
libxcomposite1 \
|
| 28 |
+
libxdamage1 \
|
| 29 |
+
libxfixes3 \
|
| 30 |
+
libxrandr2 \
|
| 31 |
+
libgbm1 \
|
| 32 |
+
libasound2 \
|
| 33 |
+
libpango-1.0-0 \
|
| 34 |
+
libcairo2 \
|
| 35 |
+
libatspi2.0-0 \
|
| 36 |
+
libxshmfence1 \
|
| 37 |
+
libglu1-mesa \
|
| 38 |
+
ca-certificates \
|
| 39 |
+
fonts-liberation \
|
| 40 |
+
chromium-driver \
|
| 41 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 42 |
+
|
| 43 |
+
# 3. Environment Settings (Moved for visibility)
|
| 44 |
+
ENV PYTHONPATH=/app
|
| 45 |
+
ENV CHROME_EXE_PATH=/usr/bin/chromium
|
| 46 |
+
ENV CHROME_BIN=/usr/bin/chromium
|
| 47 |
+
ENV CHROME_DRIVER_PATH=/usr/bin/chromedriver
|
| 48 |
+
|
| 49 |
+
# 3. FlareSolverr v3 Setup
|
| 50 |
+
RUN git clone https://github.com/FlareSolverr/FlareSolverr.git /app/flaresolverr \
|
| 51 |
+
&& cd /app/flaresolverr \
|
| 52 |
+
&& sed -i 's/driver_executable_path=driver_exe_path/driver_executable_path="\/usr\/bin\/chromedriver"/' src/utils.py \
|
| 53 |
+
&& pip install --no-cache-dir -r requirements.txt
|
| 54 |
+
|
| 55 |
+
# 4. Byparr Setup (Patched to bypass the artificial Python 3.14 requirement)
|
| 56 |
+
RUN git clone https://github.com/ThePhaseless/Byparr.git /app/byparr_src \
|
| 57 |
+
&& cd /app/byparr_src \
|
| 58 |
+
&& sed -i 's/requires-python = .*/requires-python = ">=3.11"/' pyproject.toml \
|
| 59 |
+
&& pip install --no-cache-dir .
|
| 60 |
+
|
| 61 |
+
# 5. EasyProxy Setup
|
| 62 |
+
WORKDIR /app
|
| 63 |
+
# Usiamo init e fetch invece di clone perché la cartella contiene già i solver
|
| 64 |
+
RUN git init . \
|
| 65 |
+
&& git remote add origin https://github.com/realbestia1/EasyProxy \
|
| 66 |
+
&& git fetch \
|
| 67 |
+
&& git checkout -f main
|
| 68 |
+
|
| 69 |
+
# Installiamo le dipendenze (usiamo la lista diretta per sicurezza)
|
| 70 |
+
RUN pip install --no-cache-dir \
|
| 71 |
+
aiohttp aiohttp-socks gunicorn python-dotenv zstandard \
|
| 72 |
+
beautifulsoup4 lxml python-socks pycryptodome pydash2hls \
|
| 73 |
+
playwright ddddocr Pillow curl_cffi
|
| 74 |
+
|
| 75 |
+
# Fix Python package structure
|
| 76 |
+
RUN touch __init__.py services/__init__.py extractors/__init__.py utils/__init__.py routes/__init__.py
|
| 77 |
+
|
| 78 |
+
RUN python -m playwright install chromium
|
| 79 |
+
RUN chmod +x entrypoint.sh
|
| 80 |
+
|
| 81 |
+
# 6. Execution
|
| 82 |
+
EXPOSE 7860
|
| 83 |
+
# Usiamo l'entrypoint script per avviare FlareSolverr, Byparr e EasyProxy insieme
|
| 84 |
+
ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"]
|