Spaces:
Runtime error
Runtime error
| # ÉTAPE 1 : Utilisation d'une base Ubuntu stable | |
| FROM ubuntu:22.04 | |
| # Éviter les interactions pendant l'installation | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Passage en root | |
| USER root | |
| # 1. Installation des dépendances et correction de Chromium (évite l'erreur SNAP) | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| gnupg \ | |
| ffmpeg \ | |
| ca-certificates \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| libnss3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libgbm1 \ | |
| libasound2 \ | |
| libpangocairo-1.0-0 \ | |
| libxss1 \ | |
| libgtk-3-0 \ | |
| software-properties-common | |
| # Ajout du PPA pour installer Chromium sans SNAP | |
| RUN add-apt-repository ppa:xtradeb/apps -y \ | |
| && apt-get update \ | |
| && apt-get install -y chromium | |
| # 2. Installation de Node.js et n8n | |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | |
| && apt-get install -y build-essential nodejs \ | |
| && npm install -g n8n@latest \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Chemin de l'exécutable pour Chromium | |
| ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium | |
| # Configuration des permissions | |
| RUN useradd -m -u 1000 node | |
| RUN mkdir -p /home/node/.n8n /home/node/scripts && chown -R 1000:1000 /home/node | |
| # Préparation de l'environnement virtuel Python | |
| RUN python3 -m venv /home/node/venv | |
| ENV PATH="/home/node/venv/bin:$PATH" | |
| # Installation locale des outils de capture | |
| WORKDIR /home/node/scripts | |
| RUN npm init -y && npm install puppeteer puppeteer-screen-recorder | |
| RUN chown -R 1000:1000 /home/node/scripts | |
| USER 1000 | |
| WORKDIR /home/node | |
| # VARIABLES DE CONFIGURATION | |
| ENV N8N_PORT=7860 \ | |
| N8N_LISTEN_ADDRESS=0.0.0.0 \ | |
| NODE_OPTIONS="--max-old-space-size=14336" \ | |
| N8N_COOKIES_SAME_SITE=lax \ | |
| N8N_USER_MANAGEMENT_DISABLED=true \ | |
| N8N_DISABLE_PRODUCTION_MAIN_PROCESS_TERMINATION=true \ | |
| N8N_BLOCK_NODES="" \ | |
| NODE_FUNCTION_ALLOW_BUILTIN=fs,child_process \ | |
| N8N_PAYLOAD_SIZE_MAX=5000 | |
| EXPOSE 7860 | |
| CMD ["n8n", "start"] |