-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (80 loc) · 2.51 KB
/
docker-compose.yml
File metadata and controls
84 lines (80 loc) · 2.51 KB
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
# docker-compose.yml - n8n Workflow Automation
# =============================================================================
# n8n with PostgreSQL backend. Requires .env file — run scripts/generate-env.sh
# =============================================================================
services:
# ---------------------------------------------------------------------------
# n8n: Workflow Automation Engine
# ---------------------------------------------------------------------------
n8n:
image: n8nio/n8n:2.9.2
container_name: n8n
restart: unless-stopped
env_file:
- .env
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=n8n-db
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB:-n8n}
- DB_POSTGRESDB_USER=${POSTGRES_USER:-n8n_user}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE:-UTC}
- N8N_HOST=${N8N_HOST:-0.0.0.0}
- N8N_PORT=5678
- N8N_PROTOCOL=${N8N_PROTOCOL:-https}
- WEBHOOK_URL=${WEBHOOK_URL}
- N8N_BLOCK_ENV_ACCESS_IN_NODE=true
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=168
- EXECUTIONS_DATA_PRUNE_MAX_COUNT=50000
ports:
- "${N8N_PORT:-5678}:5678"
volumes:
- n8n-data:/home/node/.n8n
depends_on:
n8n-db:
condition: service_healthy
networks:
- n8n-internal
- mcp-network
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:5678/healthz || exit 1"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
# ---------------------------------------------------------------------------
# Database: PostgreSQL 16 (dedicated to n8n)
# ---------------------------------------------------------------------------
n8n-db:
image: postgres:16-alpine
container_name: n8n-db
restart: unless-stopped
environment:
- POSTGRES_DB=${POSTGRES_DB:-n8n}
- POSTGRES_USER=${POSTGRES_USER:-n8n_user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- n8n-pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-n8n_user} -d ${POSTGRES_DB:-n8n}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- n8n-internal
expose:
- "5432"
volumes:
n8n-data:
driver: local
n8n-pgdata:
driver: local
networks:
n8n-internal:
driver: bridge
mcp-network:
external: true
name: mcp-network