Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -11
Dockerfile
CHANGED
|
@@ -3,29 +3,32 @@ FROM python:3.12-slim
|
|
| 3 |
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
| 6 |
-
# 1.
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 10 |
-
&& apt-get install -y --no-install-recommends \
|
| 11 |
-
ca-certificates g++ gnupg libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 \
|
| 12 |
libdbus-1-3 libdrm2 libexpat1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 \
|
| 13 |
libnspr4 libnss3 libpango-1.0-0 libasound2 libx11-6 libx11-xcb1 libxcb1 \
|
| 14 |
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 \
|
| 15 |
-
libxrender1 libxss1 libxtst6 libpangocairo-1.0-0 libpng16-16 wget xvfb nginx curl
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
# 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
COPY bot/requirements.txt /app/bot/requirements.txt
|
| 20 |
RUN pip install --no-cache-dir -r /app/bot/requirements.txt
|
| 21 |
|
| 22 |
-
#
|
| 23 |
RUN playwright install chromium
|
| 24 |
|
| 25 |
-
#
|
| 26 |
COPY bot/ /app/bot/
|
| 27 |
|
| 28 |
-
#
|
| 29 |
RUN chmod +x /app/start.sh
|
| 30 |
RUN mkdir -p /data && chmod 777 /data
|
| 31 |
|
|
|
|
| 3 |
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
| 6 |
+
# 1. Dépendances système (Uniquement les libs Playwright + Nginx)
|
| 7 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
+
ca-certificates g++ libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 \
|
|
|
|
|
|
|
|
|
|
| 9 |
libdbus-1-3 libdrm2 libexpat1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 \
|
| 10 |
libnspr4 libnss3 libpango-1.0-0 libasound2 libx11-6 libx11-xcb1 libxcb1 \
|
| 11 |
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 \
|
| 12 |
+
libxrender1 libxss1 libxtst6 libpangocairo-1.0-0 libpng16-16 wget xvfb nginx curl \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
+
# 2. Installation de Node.js 20 (Méthode binaire officielle, bypass apt)
|
| 16 |
+
RUN curl -fsSL https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz -o /tmp/node.tar.xz \
|
| 17 |
+
&& tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \
|
| 18 |
+
&& rm -f /tmp/node.tar.xz \
|
| 19 |
+
&& node -v && npm -v
|
| 20 |
+
|
| 21 |
+
# 3. Dépendances Python
|
| 22 |
COPY bot/requirements.txt /app/bot/requirements.txt
|
| 23 |
RUN pip install --no-cache-dir -r /app/bot/requirements.txt
|
| 24 |
|
| 25 |
+
# 4. Installation de Playwright Chromium
|
| 26 |
RUN playwright install chromium
|
| 27 |
|
| 28 |
+
# 5. Copie des fichiers du Bot
|
| 29 |
COPY bot/ /app/bot/
|
| 30 |
|
| 31 |
+
# 6. Permissions et dossier de persistance HF
|
| 32 |
RUN chmod +x /app/start.sh
|
| 33 |
RUN mkdir -p /data && chmod 777 /data
|
| 34 |
|