-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathn8n.yml
47 lines (46 loc) · 1.4 KB
/
n8n.yml
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
n8n-postgres:
image: postgres:16
container_name: n8n-postgres
restart: always
env_file:
- ./env/n8n.env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_NON_ROOT_USER=${POSTGRES_NON_ROOT_USER}
- POSTGRES_NON_ROOT_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
volumes:
- ./volumes/n8n/db_storage:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 5s
timeout: 5s
retries: 10
n8n:
image: docker.n8n.io/n8nio/n8n
container_name: n8n
restart: always
env_file:
- ./env/n8n.env
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=n8n-postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- DB_POSTGRESDB_USER=${POSTGRES_USER}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
# - N8N_HOST=example.com
# - NODE_ENV=production
# - N8N_PATH
# - WEBHOOK_URL=https://example.com
ports:
- 5678:5678
links:
- n8n-postgres
user: 0:0 # If you have problems, set ./volumes/n8n/n8n readable for all
volumes:
- ./volumes/n8n/n8n:/home/node/.n8n
depends_on:
n8n-postgres:
condition: service_healthy