Files
n8n-local/docker-compose.yml

41 lines
994 B
YAML
Raw Permalink Normal View History

2026-01-26 14:17:15 +08:00
services:
postgres:
image: postgres:15
container_name: n8n-postgres
restart: unless-stopped
environment:
POSTGRES_USER: n8n
POSTGRES_PASSWORD: n8npass
POSTGRES_DB: n8n
TZ: Asia/Shanghai
2026-01-26 14:17:15 +08:00
volumes:
- ./postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U n8n -d n8n"]
2026-01-26 14:17:15 +08:00
interval: 10s
timeout: 5s
retries: 5
n8n:
image: n8nio/n8n:2.2.4
container_name: n8n
restart: unless-stopped
ports:
- "5678:5678"
# Mac 上如遇 `Restarting (139)` 可开启以下两项:
# platform: linux/amd64
# user: "0:0"
2026-01-26 14:17:15 +08:00
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_PORT: 5432
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: n8npass
TZ: Asia/Shanghai
2026-01-26 14:17:15 +08:00
volumes:
- ./n8n-data:/home/node/.n8n
depends_on:
postgres:
condition: service_healthy