services: db: image: postgres:17 container_name: n8n-db hostname: n8n-db security_opt: - no-new-privileges:true healthcheck: test: ["CMD", "pg_isready", "-q", "-d", "n8n", "-U", "n8nuser"] timeout: 45s interval: 10s retries: 10 volumes: - /volume1/docker/n8n/db:/var/lib/postgresql/data:rw environment: TZ: Europe/Berlin POSTGRES_DB: n8n POSTGRES_USER: n8nuser POSTGRES_PASSWORD: n8npass restart: on-failure:5 n8n: image: n8nio/n8n:latest container_name: n8n healthcheck: test: ["CMD-SHELL", "nc -z 127.0.0.1 5678 || exit 1"] interval: 10s timeout: 5s retries: 3 start_period: 90s hostname: n8n user: 0:0 security_opt: - no-new-privileges:true ports: - 5678:5678 volumes: - /volume1/docker/n8n/data:/root/.n8n:rw - /volume1/docker/n8n/files:/files:rw environment: N8N_HOST: n8n.scheidel.biz WEBHOOK_URL: https://n8n.scheidel.biz GENERIC_TIMEZONE: Europe/Berlin TZ: Europe/Berlin N8N_PORT: 5678 N8N_ENCRYPTION_KEY: dOxZYTTZgXKMHkqLBIQVImayQXAVWdzGBPuFJKggzcgvgPJPXpWzqzKaUOIOGGIr N8N_PROTOCOL: https NODE_ENV: production N8N_RUNNERS_ENABLED: true N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: false N8N_SECURE_COOKIE: false #or false if you want to use n8n without synology.me DDNS DB_TYPE: postgresdb DB_POSTGRESDB_DATABASE: n8n DB_POSTGRESDB_HOST: n8n-db DB_POSTGRESDB_PORT: 5432 DB_POSTGRESDB_USER: n8nuser DB_POSTGRESDB_PASSWORD: n8npass restart: on-failure:5 depends_on: db: condition: service_healthy