# 1. Base stable immuable (Debian Bookworm) FROM debian:bookworm-slim@sha256:74d56e3931e0d5a1dd51f8c8a2466d21de84a271cd3b5a733b803aa91abf4421 WORKDIR /usr/local/n8n # 2. Dépendances système (Inclut fontconfig et polices standards) USER root RUN apt-get update && apt-get install -y --no-install-recommends \ git build-essential curl ffmpeg wget unzip libopenblas-dev \ libasound2 libsndfile1 python3 python3-pip postgresql-client \ fontconfig fonts-liberation fonts-dejavu \ chromium ca-certificates && rm -rf /var/lib/apt/lists/* # 3. Node.js FIXÉ (v22.x LTS) RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ && apt-get install -y nodejs # 4. n8n FIXÉ (Version 2.11.3) + Nodes FFmpeg RUN npm install -g n8n@2.11.3 n8n-nodes-ffmpeg@0.1.2 --omit=dev && \ npm cache clean --force # 5. INSTALL PIPER TTS (Binaire) RUN wget https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_linux_x86_64.tar.gz && \ tar -xvf piper_linux_x86_64.tar.gz && \ mv piper /usr/local/bin/piper_bin && \ ln -s /usr/local/bin/piper_bin/piper /usr/local/bin/piper && \ chmod +x /usr/local/bin/piper_bin/piper # 6. BIBLIOTHÈQUE DE MODÈLES PIPER (FR) RUN mkdir -p /models/piper && \ wget -L -O /models/piper/fr_upmc.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/834f23262168a7e809179465e4113f23f5a7d1f7/fr/fr_FR/upmc/medium/fr_FR-upmc-medium.onnx" && \ wget -L -O /models/piper/fr_upmc.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/834f23262168a7e809179465e4113f23f5a7d1f7/fr/fr_FR/upmc/medium/fr_FR-upmc-medium.onnx.json" && \ wget -L -O /models/piper/fr_siwis.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/834f23262168a7e809179465e4113f23f5a7d1f7/fr/fr_FR/siwis/medium/fr_FR-siwis-medium.onnx" && \ wget -L -O /models/piper/fr_siwis.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/834f23262168a7e809179465e4113f23f5a7d1f7/fr/fr_FR/siwis/medium/fr_FR-siwis-medium.onnx.json" # 7. USER + PERMISSIONS RUN adduser --disabled-password --gecos "" node \ && chown -R node:node /usr/local/n8n \ && mkdir -p /data/outputs /home/node/.n8n-files \ && chown -R node:node /data /home/node /models # 8. PYTHON IA - RÉSOLUTION DU CONFLIT PKG_RESOURCES RUN python3 -m pip install --break-system-packages --upgrade pip==24.0 wheel==0.43.0 && \ python3 -m pip install --break-system-packages "setuptools<81.0.0" "setuptools-rust" && \ python3 -m pip install --break-system-packages \ torch==2.1.0+cpu torchaudio==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu && \ python3 -m pip install --break-system-packages --no-build-isolation \ openai-whisper==20231117 \ stable-ts==2.19.1 \ transformers==4.38.1 \ accelerate==0.27.2 \ soundfile==0.12.1 \ numpy==1.26.4 \ yt-dlp # 9. GESTION DES DONNÉES COPY --chown=node:node data/ /data/ USER node # 10. CONFIGURATION n8n v2 (Hugging Face Optimized) ENV GENERIC_TIMEZONE=Africa/Kinshasa ENV TZ=Africa/Kinshasa ENV N8N_HOST=0.0.0.0 ENV N8N_PORT=7860 ENV N8N_PROTOCOL=https ENV N8N_ENCRYPTION_KEY=votre_cle_secrete_fixe ENV N8N_DATA_FOLDER=/data # --- FIX n8n v2 Security --- ENV NODES_EXCLUDE="[]" ENV N8N_BLOCK_ENV_ACCESS_IN_NODE=false ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false # --- FIX n8n v2 Task Runners --- ENV N8N_RUNNERS_MODE=internal ENV N8N_NATIVE_PYTHON_RUNNER=false # Whitelist pour les nœuds de lecture/écriture ENV N8N_FILESYSTEM_ALLOWLIST=/home/node/.n8n-files/,/tmp/,/data/,/models/ # Base de données (Postgres) ENV DB_TYPE=postgresdb ENV DB_POSTGRESDB_HOST=localhost ENV DB_POSTGRESDB_PORT=5432 ENV DB_POSTGRESDB_DATABASE=n8n ENV DB_POSTGRESDB_USER=user ENV DB_POSTGRESDB_PASSWORD=motdepasse # Optimisations ENV PUPPETEER_SKIP_DOWNLOAD=true ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium ENV PYTHONUNBUFFERED=1 # --- UNLIMITED TIMEOUT CONFIG --- # On met -1 pour dire "Pas de limite de temps" au niveau global de n8n ENV N8N_EXECUTION_TIMEOUT=-1 # Augmente le timeout du Task Runner à 1 heure (3600 secondes) au lieu de 300 ENV N8N_RUNNERS_TASK_TIMEOUT=3600 # On empêche n8n de supprimer les données d'exécution trop vite ENV N8N_EXECUTION_MAX_AGE=1000 WORKDIR /data EXPOSE 7860 CMD ["n8n", "start"]