40 lines
No EOL
1.1 KiB
YAML
40 lines
No EOL
1.1 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16
|
|
restart: always
|
|
container_name: postgres
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=n8n
|
|
- POSTGRES_NON_ROOT_USER=n8n
|
|
- POSTGRES_NON_ROOT_PASSWORD=n8n
|
|
volumes:
|
|
- /app-config/n8n/db_storage:/var/lib/postgresql/data
|
|
- /app-config/n8n/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
|
|
|
|
n8n:
|
|
image: docker.n8n.io/n8nio/n8n
|
|
restart: always
|
|
container_name: n8n
|
|
environment:
|
|
- DB_TYPE=postgresdb
|
|
- DB_POSTGRESDB_HOST=postgres
|
|
- DB_POSTGRESDB_PORT=5432
|
|
- DB_POSTGRESDB_DATABASE=n8n
|
|
- DB_POSTGRESDB_USER=n8n
|
|
- DB_POSTGRESDB_PASSWORD=n8n
|
|
ports:
|
|
- 5678:5678
|
|
links:
|
|
- postgres
|
|
volumes:
|
|
- /app-config/n8n/n8n_storage:/home/node/.n8n
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy |