38 lines
973 B
YAML
38 lines
973 B
YAML
|
|
services:
|
||
|
|
postgres:
|
||
|
|
image: postgres:15
|
||
|
|
container_name: n8n-postgres
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
||
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
||
|
|
TZ: ${TZ}
|
||
|
|
volumes:
|
||
|
|
- ./postgres-data:/var/lib/postgresql/data
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||
|
|
interval: 10s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
|
||
|
|
n8n:
|
||
|
|
image: n8nio/n8n:2.2.4
|
||
|
|
container_name: n8n
|
||
|
|
restart: unless-stopped
|
||
|
|
ports:
|
||
|
|
- "${N8N_PORT}:5678"
|
||
|
|
environment:
|
||
|
|
DB_TYPE: postgresdb
|
||
|
|
DB_POSTGRESDB_HOST: postgres
|
||
|
|
DB_POSTGRESDB_PORT: 5432
|
||
|
|
DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}
|
||
|
|
DB_POSTGRESDB_USER: ${POSTGRES_USER}
|
||
|
|
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
|
||
|
|
TZ: ${TZ}
|
||
|
|
volumes:
|
||
|
|
- ./n8n-data:/home/node/.n8n
|
||
|
|
depends_on:
|
||
|
|
postgres:
|
||
|
|
condition: service_healthy
|