From 51e8434799252ce65e0c46d32bc89f466c20dd02 Mon Sep 17 00:00:00 2001 From: pedrodlt Date: Tue, 20 Jan 2026 09:45:05 -0500 Subject: [PATCH] dockercompose1 --- docker-compose.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index e69de29..818ac70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -0,0 +1,45 @@ +version: '3.8' + +volumes: + db_storage: + n8n_storage: + + +services: + postgres: + image: postgres:16 + restart: always + environment: + - POSTGRES_USER + - POSTGRES_PASSWORD + - POSTGRES_DB + - POSTGRES_NON_ROOT_USER + - POSTGRES_NON_ROOT_PASSWORD + volumes: + - db_storage:/var/lib/postgresql/data + - ./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 + 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} + ports: + - 5678:5678 + links: + - postgres + volumes: + - n8n_storage:/home/node/.n8n + depends_on: + postgres: + condition: service_healthy