first commit

This commit is contained in:
muzi
2026-01-26 14:17:15 +08:00
commit bcf6514564
4 changed files with 74 additions and 0 deletions

37
docker-compose.yml Normal file
View File

@ -0,0 +1,37 @@
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