homelab/compose_files/n8n.yml
2026-03-25 20:21:13 -04:00

55 lines
1.1 KiB
YAML

version: '3.8'
# Deploy with:
# docker stack deploy -c n8n.yml n8n
#
# Runs on: CADDY_INSTANCE (ip-10-0-1-168)
# Accessible publicly via Caddy reverse proxy at n8n.erdaverse.com
services:
n8n:
image: n8nio/n8n:latest
entrypoint: /bin/sh
command:
- -c
- |
export DB_POSTGRESDB_PASSWORD=$(cat /run/secrets/n8n_db_password)
exec n8n
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_PORT: 5432
DB_POSTGRESDB_DATABASE: n8n_db
DB_POSTGRESDB_USER: n8n_user
N8N_HOST: n8n.erdaverse.com
N8N_PORT: 5678
N8N_PROTOCOL: https
WEBHOOK_URL: https://n8n.erdaverse.com
GENERIC_TIMEZONE: UTC
NODES_EXCLUDE: "[]"
secrets:
- n8n_db_password
volumes:
- n8n_data:/home/node/.n8n
networks:
- erda-net
deploy:
replicas: 1
placement:
constraints:
- node.hostname == ip-10-0-1-168
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
secrets:
n8n_db_password:
external: true
volumes:
n8n_data:
networks:
erda-net:
external: true