Spaces:
Sleeping
Sleeping
File size: 3,306 Bytes
1c808aa 081a9f5 29fdfb4 76890c9 b505b3a 76890c9 b505b3a 76890c9 9b45678 29fdfb4 b505b3a 9219345 29fdfb4 9219345 9018d32 cf22fc4 081a9f5 76890c9 29fdfb4 76890c9 1c808aa 9ec903f 1c808aa f4d934e 1c808aa f4d934e 29fdfb4 0c56516 29fdfb4 201aff4 1c808aa bd0064b 1c808aa 20976d6 2b39fd6 fb5836f 76890c9 b505b3a dd6ac58 fb5836f dd6ac58 4103329 fb5836f dd6ac58 b505b3a 9018d32 76890c9 fce3c67 b505b3a 851f4a8 1c808aa b505b3a 1c808aa b505b3a 1c808aa 9018d32 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | # Dockerfile n8n + SANS CACHE TTS (VERSION NEUTRE STABLE)
#by Dieu Merci Mvemba
# 1. Image de base Debian Bookworm (12)
FROM debian:bookworm-slim
# Définir le répertoire de travail
WORKDIR /usr/local/n8n
# Installer les dépendances système (apt-get)
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
build-essential \
curl \
ffmpeg \
libopenblas-dev \
libasound2 \
libsndfile1 \
python3 \
python3-pip \
postgresql-client \
chromium \
libnss3 \
libxtst6 \
libpangocairo-1.0-0 \
libxcomposite1 \
libxi6 \
libatk-bridge2.0-0 \
libgbm-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# AJOUT CRITIQUE : Installation de Node.js v20 (pour n8n)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs
# Installer N8N (LATEST)
RUN npm install -g n8n@latest
RUN npm install -g @n8n/n8n-nodes-langchain@latest
RUN npm install -g n8n-nodes-ffmpeg@latest
# FIX: éviter le doublon de @n8n/n8n-nodes-langchain chargé 2 fois
# (supprime la copie imbriquée sous n8n si elle existe)
RUN rm -rf /usr/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain || true
# Créer l'utilisateur 'node' et changer le propriétaire
RUN adduser --disabled-password --gecos "" node \
&& chown -R node:node /usr/local/n8n
# --- INSTALLATIONS CRITIQUES POUR L'IA AUDIO (TTS et Whisper) + yt-dlp ---
# 1. Mise à jour de pip/setuptools (AVEC FIX PEP 668)
RUN python3 -m pip install --break-system-packages --upgrade pip setuptools wheel
# 2. Installation des librairies Python AI (AVEC FIX PEP 668)
RUN python3 -m pip install --break-system-packages \
torch \
transformers \
accelerate \
soundfile \
openai-whisper \
stable-ts \
numpy \
yt-dlp \
TTS
# --- FIN DES INSTALLATIONS (PAS DE CACHE TTS) ---
# 3. CRUCIAL : Copie des fichiers et ajustement des permissions
COPY data/ /data/
RUN chown -R node:node /data
USER node
# 4. Variables d'environnement
ENV N8N_HOST=0.0.0.0
ENV N8N_PORT=7860
ENV N8N_PROTOCOL=https
ENV GENERIC_TIMEZONE=Africa/Kinshasa
ENV TZ=Africa/Kinshasa
ENV N8N_ENCRYPTION_KEY=a_secret_key_to_be_replaced
ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
ENV N8N_EXPRESS_SERVER_SET_PROXY_HOST=true
ENV N8N_GIT_NODE_DISABLE_BARE_REPOS=true
ENV N8N_BASIC_AUTH_ACTIVE=true
ENV WEBHOOK_URL=https://<USER>-<SPACE_NAME>.hf.space/
ENV N8N_EDITOR_BASE_URL=https://<USER>-<SPACE_NAME>.hf.space/
ENV allowVulnerableTags=true
ENV DB_TYPE=postgresdb
ENV DB_POSTGRESDB_HOST=localhost
ENV DB_POSTGRESDB_DATABASE=n8n
ENV DB_POSTGRESDB_USER=user
ENV DB_POSTGRESDB_PASSWORD=motdepasse
ENV DB_POSTGRESDB_PORT=5432
ENV NODE_FUNCTION_ALLOW_BUILTIN=*
ENV NODE_FUNCTION_ALLOW_EXTERNAL=*
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
ENV N8N_DATA_FOLDER=/data
ENV N8N_FILESYSTEM_ALLOWLIST=/home/node/.n8n-files:/tmp
# ==============================
# ACTIVER EXECUTE COMMAND
# ==============================
ENV N8N_ALLOW_EXECUTE_COMMAND=true
ENV N8N_ENABLE_NODE_DEV=true
ENV NODES_EXCLUDE=
# Définir répertoire de travail
WORKDIR /data
# Expose le port pour Hugging Face Spaces
EXPOSE 7860
# Lancer n8n (exécuté par l'utilisateur 'node')
CMD ["n8n", "start", "--port", "7860"]
|