-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
64 lines (64 loc) · 1.51 KB
/
compose.yaml
File metadata and controls
64 lines (64 loc) · 1.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
name: n8n
services:
postgres:
image: postgres:16
x-defang-postgres: true
restart: always
environment:
- POSTGRES_USER=n8nuser
- POSTGRES_DB=n8ndatabase
- POSTGRES_PASSWORD
healthcheck:
test:
- CMD-SHELL
- pg_isready -h localhost -U n8nuser -d n8ndatabase
interval: 5s
timeout: 5s
retries: 10
deploy:
resources:
reservations:
cpus: '0.5'
memory: 512M
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8ndatabase
- DB_POSTGRESDB_USER=n8nuser
- N8N_RUNNERS_ENABLED=true
- N8N_HOST=n8n
- N8N_PORT=5678
- N8N_PROTOCOL=https
- N8N_PROXY_HOPS=1
- NODE_ENV=production
- WEBHOOK_URL=https://n8n
- DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED
- DB_POSTGRESDB_SSL_ENABLED
- N8N_ENCRYPTION_KEY
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
ports:
- 5678:5678
links:
- postgres
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- node --eval "const r = await fetch('http://localhost:5678/healthz'); if(r.status
=== 200 || r.status === 201) { process.exit(0); } else { process.exit(1);
};"
interval: 10s
timeout: 5s
retries: 5
start_period: 120s
deploy:
resources:
reservations:
cpus: '0.5'
memory: 512M