2022-08-19 03:44:34 -07:00
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
db_storage:
|
|
|
|
n8n_storage:
|
2019-08-21 12:56:23 -07:00
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:11
|
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER
|
|
|
|
- POSTGRES_PASSWORD
|
|
|
|
- POSTGRES_DB
|
|
|
|
- POSTGRES_NON_ROOT_USER
|
|
|
|
- POSTGRES_NON_ROOT_PASSWORD
|
|
|
|
volumes:
|
2022-08-19 03:44:34 -07:00
|
|
|
- db_storage:/var/lib/postgresql/data
|
2019-08-21 12:56:23 -07:00
|
|
|
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
2022-08-19 03:44:34 -07:00
|
|
|
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
|
2019-08-21 12:56:23 -07:00
|
|
|
|
|
|
|
n8n:
|
|
|
|
image: n8nio/n8n
|
|
|
|
restart: always
|
|
|
|
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}
|
2019-09-26 07:12:04 -07:00
|
|
|
- N8N_BASIC_AUTH_ACTIVE=true
|
|
|
|
- N8N_BASIC_AUTH_USER
|
|
|
|
- N8N_BASIC_AUTH_PASSWORD
|
2019-08-21 12:56:23 -07:00
|
|
|
ports:
|
|
|
|
- 5678:5678
|
|
|
|
links:
|
|
|
|
- postgres
|
|
|
|
volumes:
|
2022-12-07 06:54:26 -08:00
|
|
|
- n8n_storage:/home/node/.n8n
|
2022-08-19 03:44:34 -07:00
|
|
|
command: /bin/sh -c "n8n start --tunnel"
|
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|