From 10fc3f0704cf1ed7a26e5bb4f5c7a272ac8c47d5 Mon Sep 17 00:00:00 2001 From: Maksym Buz <79866323+xopek-by@users.noreply.github.com> Date: Wed, 30 Jul 2025 14:54:18 +0200 Subject: [PATCH] Redisign from PostgreSQL to SQLite --- n8m/.env | 13 +++---------- n8m/compose.yml | 48 +++++++++++------------------------------------- 2 files changed, 14 insertions(+), 47 deletions(-) diff --git a/n8m/.env b/n8m/.env index 520bafd..6078d66 100644 --- a/n8m/.env +++ b/n8m/.env @@ -1,10 +1,3 @@ -POSTGRES_USER=changeUser -POSTGRES_PASSWORD=changePassword -POSTGRES_DB=n8n - -POSTGRES_NON_ROOT_USER=changeUser -POSTGRES_NON_ROOT_PASSWORD=changePassword - -PATH_TO_POSTGRES=/home/user/docker/n8m/postgres -PATH_TO_APP=/home/user/docker/n8m/app -PATH_TO_SCRIPT=/home/user/docker/n8m/init-data.sh \ No newline at end of file +PATH_TO_DATA=/home/user/docker/n8m +GENERIC_TIMEZONE=Europe/Warsaw +HOSTNAME=n8m.yourdomain.com \ No newline at end of file diff --git a/n8m/compose.yml b/n8m/compose.yml index f830f4a..6a477e8 100644 --- a/n8m/compose.yml +++ b/n8m/compose.yml @@ -1,41 +1,15 @@ -services: - postgres: - image: postgres:16 - restart: always - environment: - - POSTGRES_USER - - POSTGRES_PASSWORD - - POSTGRES_DB - - POSTGRES_NON_ROOT_USER - - POSTGRES_NON_ROOT_PASSWORD - volumes: - # PostgreSQL will be stored in a local folder - - ${PATH_TO_POSTGRES}:/var/lib/postgresql/data - - ${PATH_TO_SCRIPT}:/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 - command: n8n - 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} + restart: unless-stopped ports: - - 5678:5678 - links: - - postgres + - "5678:5678" + environment: + - N8N_HOST=${HOSTNAME} + - N8N_PORT=5678 + - N8N_PROTOCOL=https + - NODE_ENV=production + - WEBHOOK_URL=https://${HOSTNAME}/ + - GENERIC_TIMEZONE=${GENERIC_TIMEZONE} volumes: - # n8n data will be stored in a local folder - - ${PATH_TO_APP}:/home/node/.n8n - depends_on: - postgres: - condition: service_healthy + - n8n_data:/home/node/.n8n + - ${PATH_TO_DATA}:/files \ No newline at end of file