Entre no coolify, depois em N8N, copie o composer file original para o editor de texto para backup, cole os comandos baixo, coloque a sua N8N_ENCRYPTION_KEY original no lugar correto no arquivo abaixo, salve e restart ou deploy.
services:
n8n:
build:
context: .
dockerfile_inline: "FROM n8nio/n8n:latest\nUSER root\nRUN wget -O /tmp/ffmpeg https://github.com/eugeneware/ffmpeg-static/releases/download/b6.0/ffmpeg-linux-x64 && \\\n chmod +x /tmp/ffmpeg && \\\n mv /tmp/ffmpeg /usr/local/bin/ffmpeg\nUSER node\n"
environment:
- SERVICE_URL_N8N_5678
- 'N8N_EDITOR_BASE_URL=${SERVICE_URL_N8N}'
- 'WEBHOOK_URL=${SERVICE_URL_N8N}'
- 'N8N_HOST=${SERVICE_URL_N8N}'
- 'GENERIC_TIMEZONE=${GENERIC_TIMEZONE:-Europe/Berlin}'
- 'TZ=${TZ:-Europe/Berlin}'
- DB_TYPE=postgresdb
- 'DB_POSTGRESDB_DATABASE=${POSTGRES_DB:-n8n}'
- DB_POSTGRESDB_HOST=postgresql
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_USER=$SERVICE_USER_POSTGRES
- DB_POSTGRESDB_SCHEMA=public
- DB_POSTGRESDB_PASSWORD=$SERVICE_PASSWORD_POSTGRES
- N8N_ENCRYPTION_KEY=COLOQUE A SUA ENCRYPTION KEY ORIGINAL AQUI!!
- NODE_FUNCTION_ALLOW_BUILTIN=child_process
volumes:
- 'n8n-data:/home/node/.n8n'
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- 'wget -qO- http://127.0.0.1:5678/'
interval: 5s
timeout: 20s
retries: 10
postgresql:
image: 'postgres:16-alpine'
volumes:
- 'postgresql-data:/var/lib/postgresql/data'
environment:
- POSTGRES_USER=$SERVICE_USER_POSTGRES
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
- 'POSTGRES_DB=${POSTGRES_DB:-n8n}'
healthcheck:
test:
- CMD-SHELL
- 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'
interval: 5s
timeout: 20s
retries: 10
O comando “Execute comando” foi retirado no N8N, para fazer o equivalente execute o codigo em javascript.
Para testar se ffmpeg foi instalado, coloque um nó code->javascript, cole o bloco abaixo e execute, vai aparecer a versão do seu ffmpeg.
const { execSync } = require('child_process');
try {
const result = execSync('ffmpeg -version 2>&1').toString();
return [{ json: { installed: true, version: result } }];
} catch(e) {
return [{ json: { installed: false, error: e.message } }];
}
Share this content:
