2024-08-29 23:42:01 -07:00
|
|
|
services:
|
|
|
|
redis:
|
|
|
|
image: redis:6-alpine
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
2024-09-02 04:58:24 -07:00
|
|
|
healthcheck:
|
|
|
|
test: ['CMD', 'redis-cli', 'ping']
|
|
|
|
interval: 1s
|
|
|
|
timeout: 3s
|
|
|
|
|
2024-08-29 23:42:01 -07:00
|
|
|
postgres:
|
|
|
|
image: postgres:16
|
2024-09-02 04:58:24 -07:00
|
|
|
user: ${RUN_USER_AND_GROUP}
|
2024-08-29 23:42:01 -07:00
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=n8n
|
|
|
|
- POSTGRES_USER=postgres
|
|
|
|
- POSTGRES_PASSWORD=password
|
2024-09-02 04:58:24 -07:00
|
|
|
- PGDATA=/var/lib/postgresql/data/pgdata
|
|
|
|
volumes:
|
|
|
|
- ${RUN_DIR}/postgres:/var/lib/postgresql/data
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD-SHELL', 'pg_isready -U postgres']
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
|
2024-08-29 23:42:01 -07:00
|
|
|
n8n_worker1:
|
|
|
|
image: ghcr.io/n8n-io/n8n:${N8N_VERSION:-latest}
|
2024-09-02 04:58:24 -07:00
|
|
|
user: ${RUN_USER_AND_GROUP}
|
2024-08-29 23:42:01 -07:00
|
|
|
environment:
|
|
|
|
- N8N_DIAGNOSTICS_ENABLED=false
|
|
|
|
- N8N_USER_FOLDER=/n8n/worker1
|
|
|
|
- N8N_ENCRYPTION_KEY=very-secret-encryption-key
|
2024-09-02 04:58:24 -07:00
|
|
|
# Queue mode config
|
2024-08-29 23:42:01 -07:00
|
|
|
- EXECUTIONS_MODE=queue
|
|
|
|
- QUEUE_BULL_REDIS_HOST=redis
|
2024-09-02 04:58:24 -07:00
|
|
|
- QUEUE_HEALTH_CHECK_ACTIVE=true
|
|
|
|
# DB config
|
2024-08-29 23:42:01 -07:00
|
|
|
- DB_TYPE=postgresdb
|
|
|
|
- DB_POSTGRESDB_HOST=postgres
|
|
|
|
- DB_POSTGRESDB_PASSWORD=password
|
|
|
|
command: worker
|
|
|
|
volumes:
|
2024-09-02 04:58:24 -07:00
|
|
|
- ${RUN_DIR}/n8n-worker1:/n8n
|
2024-08-29 23:42:01 -07:00
|
|
|
depends_on:
|
2024-09-02 04:58:24 -07:00
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD-SHELL', 'wget --spider -q http://localhost:5678/healthz || exit 1']
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
|
2024-08-29 23:42:01 -07:00
|
|
|
n8n_worker2:
|
|
|
|
image: ghcr.io/n8n-io/n8n:${N8N_VERSION:-latest}
|
2024-09-02 04:58:24 -07:00
|
|
|
user: ${RUN_USER_AND_GROUP}
|
2024-08-29 23:42:01 -07:00
|
|
|
environment:
|
|
|
|
- N8N_DIAGNOSTICS_ENABLED=false
|
|
|
|
- N8N_USER_FOLDER=/n8n/worker2
|
|
|
|
- N8N_ENCRYPTION_KEY=very-secret-encryption-key
|
2024-09-02 04:58:24 -07:00
|
|
|
# Queue mode config
|
2024-08-29 23:42:01 -07:00
|
|
|
- EXECUTIONS_MODE=queue
|
|
|
|
- QUEUE_BULL_REDIS_HOST=redis
|
2024-09-02 04:58:24 -07:00
|
|
|
- QUEUE_HEALTH_CHECK_ACTIVE=true
|
|
|
|
# DB config
|
2024-08-29 23:42:01 -07:00
|
|
|
- DB_TYPE=postgresdb
|
|
|
|
- DB_POSTGRESDB_HOST=postgres
|
|
|
|
- DB_POSTGRESDB_PASSWORD=password
|
|
|
|
command: worker
|
|
|
|
volumes:
|
2024-09-02 04:58:24 -07:00
|
|
|
- ${RUN_DIR}/n8n-worker2:/n8n
|
2024-08-29 23:42:01 -07:00
|
|
|
depends_on:
|
2024-09-02 04:58:24 -07:00
|
|
|
# We let the worker 1 start first so it can run the DB migrations
|
|
|
|
n8n_worker1:
|
|
|
|
condition: service_healthy
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD-SHELL', 'wget --spider -q http://localhost:5678/healthz || exit 1']
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
|
2024-08-29 23:42:01 -07:00
|
|
|
n8n:
|
|
|
|
image: ghcr.io/n8n-io/n8n:${N8N_VERSION:-latest}
|
2024-09-02 04:58:24 -07:00
|
|
|
user: ${RUN_USER_AND_GROUP}
|
2024-08-29 23:42:01 -07:00
|
|
|
environment:
|
|
|
|
- N8N_DIAGNOSTICS_ENABLED=false
|
|
|
|
- N8N_USER_FOLDER=/n8n/main
|
|
|
|
- N8N_ENCRYPTION_KEY=very-secret-encryption-key
|
2024-09-02 04:58:24 -07:00
|
|
|
# Queue mode config
|
2024-08-29 23:42:01 -07:00
|
|
|
- EXECUTIONS_MODE=queue
|
|
|
|
- QUEUE_BULL_REDIS_HOST=redis
|
2024-09-02 04:58:24 -07:00
|
|
|
# DB config
|
2024-08-29 23:42:01 -07:00
|
|
|
- DB_TYPE=postgresdb
|
|
|
|
- DB_POSTGRESDB_HOST=postgres
|
|
|
|
- DB_POSTGRESDB_PASSWORD=password
|
|
|
|
ports:
|
|
|
|
- 5678:5678
|
|
|
|
volumes:
|
2024-09-02 04:58:24 -07:00
|
|
|
- ${RUN_DIR}/n8n-main:/n8n
|
2024-08-29 23:42:01 -07:00
|
|
|
depends_on:
|
2024-09-02 04:58:24 -07:00
|
|
|
n8n_worker1:
|
|
|
|
condition: service_healthy
|
|
|
|
n8n_worker2:
|
|
|
|
condition: service_healthy
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD-SHELL', 'wget --spider -q http://localhost:5678/healthz || exit 1']
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
|
2024-08-29 23:42:01 -07:00
|
|
|
benchmark:
|
|
|
|
image: ghcr.io/n8n-io/n8n-benchmark:${N8N_BENCHMARK_VERSION:-latest}
|
|
|
|
depends_on:
|
2024-09-02 04:58:24 -07:00
|
|
|
n8n:
|
|
|
|
condition: service_healthy
|
2024-08-29 23:42:01 -07:00
|
|
|
environment:
|
|
|
|
- N8N_BASE_URL=http://n8n:5678
|
|
|
|
- K6_API_TOKEN=${K6_API_TOKEN}
|