2022-08-19 03:44:34 -07:00
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
db_storage:
|
|
|
|
n8n_storage:
|
|
|
|
redis_storage:
|
|
|
|
|
|
|
|
x-shared: &shared
|
|
|
|
restart: always
|
2023-07-12 02:55:19 -07:00
|
|
|
image: docker.n8n.io/n8nio/n8n
|
2022-08-19 03:44:34 -07:00
|
|
|
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_HEALTH_CHECK_ACTIVE=true
|
|
|
|
links:
|
|
|
|
- postgres
|
|
|
|
- redis
|
|
|
|
volumes:
|
2022-12-07 06:54:26 -08:00
|
|
|
- n8n_storage:/home/node/.n8n
|
2022-08-19 03:44:34 -07:00
|
|
|
depends_on:
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:11
|
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER
|
|
|
|
- POSTGRES_PASSWORD
|
|
|
|
- POSTGRES_DB
|
|
|
|
- POSTGRES_NON_ROOT_USER
|
|
|
|
- POSTGRES_NON_ROOT_PASSWORD
|
|
|
|
volumes:
|
|
|
|
- db_storage:/var/lib/postgresql/data
|
|
|
|
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
|
|
|
healthcheck:
|
2022-11-22 05:11:29 -08:00
|
|
|
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
|
2022-08-19 03:44:34 -07:00
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:6-alpine
|
|
|
|
restart: always
|
|
|
|
volumes:
|
|
|
|
- redis_storage:/data
|
|
|
|
healthcheck:
|
2022-11-22 05:11:29 -08:00
|
|
|
test: ['CMD', 'redis-cli', 'ping']
|
2022-08-19 03:44:34 -07:00
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
|
|
|
|
n8n:
|
|
|
|
<<: *shared
|
|
|
|
ports:
|
|
|
|
- 5678:5678
|
|
|
|
|
|
|
|
n8n-worker:
|
|
|
|
<<: *shared
|
2023-07-12 02:55:19 -07:00
|
|
|
command: worker
|
2022-08-19 03:44:34 -07:00
|
|
|
depends_on:
|
|
|
|
- n8n
|