-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
128 lines (116 loc) · 3.15 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
128 lines (116 loc) · 3.15 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
volumes:
db_storage:
name: db_storage
n8n_storage:
name: n8n_storage
redis_storage:
name: redis_storage
x-shared: &shared
restart: always
image: n8nio/n8n:${N8N_VERSION}
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
- EXECUTIONS_MODE=queue
- QUEUE_BULL_REDIS_HOST=redis
- QUEUE_BULL_REDIS_PASSWORD=${REDIS_PASSWORD}
- QUEUE_HEALTH_CHECK_ACTIVE=true
- N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
- GENERIC_TIMEZONE=${TIMEZONE}
- TZ=${TIMEZONE}
- N8N_RUNNERS_ENABLED=true
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
- N8N_RUNNERS_AUTH_TOKEN=${RUNNERS_AUTH_TOKEN}
- N8N_NATIVE_PYTHON_RUNNER=true
- NODES_EXCLUDE="[]"
- N8N_SKIP_AUTH_ON_OAUTH_CALLBACK="false"
- OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
- VUE_APP_URL_BASE_API=http://localhost:5678/
- N8N_EDITOR_BASE_URL=http://localhost:5678/
- WEBHOOK_URL=http://localhost:5678/
links:
- postgres
- redis
volumes:
- n8n_storage:/home/node/.n8n
# depends_on:
# redis:
# condition: service_healthy
# postgres:
# condition: service_healthy
services:
postgres:
image: postgres:18
container_name: n8n-postgres
restart: always
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_NON_ROOT_USER
- POSTGRES_NON_ROOT_PASSWORD
- GENERIC_TIMEZONE=${TIMEZONE}
- TZ=${TIMEZONE}
volumes:
- db_storage:/var/lib/postgresql
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
# healthcheck:
# test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
# interval: 5s
# timeout: 5s
# retries: 10
redis:
image: redis:8-alpine
container_name: n8n-redis
command:
- redis-server
- --requirepass
- ${REDIS_PASSWORD}
- --save
- ""
- --appendonly
- "no"
restart: always
volumes:
- redis_storage:/data
environment:
- GENERIC_TIMEZONE=${TIMEZONE}
- TZ=${TIMEZONE}
# healthcheck:
# test: ['CMD', 'redis-cli', 'ping']
# interval: 5s
# timeout: 5s
# retries: 10
n8n-main:
<<: *shared
container_name: n8n-main
ports:
- "5678:5678"
n8n-worker:
<<: *shared
container_name: n8n-worker
command: worker
n8n-custom-runner:
build:
context: ./n8n-custom-runner
dockerfile: Dockerfile
args:
N8N_VERSION: ${N8N_VERSION}
image: n8n-custom-runner
container_name: n8n-custom-runner
restart: always
environment:
- N8N_RUNNERS_TASK_BROKER_URI=http://n8n-worker:5679
- N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
- N8N_RUNNERS_AUTH_TOKEN=${RUNNERS_AUTH_TOKEN}
- GENERIC_TIMEZONE=${TIMEZONE}
- TZ=${TIMEZONE}
- N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT=0
- N8N_RUNNERS_ALLOW_TRANSITIVE_IMPORTS=true
depends_on:
- n8n-worker