diff --git a/blueprints/n8n-with-postgres/docker-compose.yml b/blueprints/n8n-with-postgres/docker-compose.yml new file mode 100644 index 00000000..1f314b47 --- /dev/null +++ b/blueprints/n8n-with-postgres/docker-compose.yml @@ -0,0 +1,50 @@ +services: + postgres: + image: postgres:17-alpine + restart: unless-stopped + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=${POSTGRES_DB} + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] + start_period: 30s + interval: 10s + timeout: 5s + retries: 5 + + n8n: + image: n8nio/n8n:latest + restart: unless-stopped + environment: + # Configuration PostgreSQL + - 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} + + # SÉCURITÉ - Encryption (IMPORTANT) + - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY} + + # Configuration réseau + - N8N_HOST=${N8N_HOST} + - N8N_PORT=${N8N_PORT} + - N8N_PROTOCOL=http + - NODE_ENV=production + - WEBHOOK_URL=https://${N8N_HOST}/ + - GENERIC_TIMEZONE=${GENERIC_TIMEZONE} + - N8N_SECURE_COOKIE=false + + volumes: + - n8n_data:/home/node/.n8n + depends_on: + postgres: + condition: service_healthy + +volumes: + n8n_data: + postgres_data: diff --git a/blueprints/n8n-with-postgres/n8n.png b/blueprints/n8n-with-postgres/n8n.png new file mode 100644 index 00000000..0e9a607e Binary files /dev/null and b/blueprints/n8n-with-postgres/n8n.png differ diff --git a/blueprints/n8n-with-postgres/template.toml b/blueprints/n8n-with-postgres/template.toml new file mode 100644 index 00000000..ea1e9519 --- /dev/null +++ b/blueprints/n8n-with-postgres/template.toml @@ -0,0 +1,29 @@ +[variables] +main_domain = "${domain}" +# Variables PostgreSQL +postgres_user = "${username}" +postgres_password = "${password:24}" +postgres_db = "n8n" +# SÉCURITÉ - Clé d'encryption (IMPORTANT) +n8n_encryption_key = "${base64:64}" + +[config] +mounts = [] + +[[config.domains]] +serviceName = "n8n" +port = 5_678 +host = "${main_domain}" + +[config.env] +N8N_HOST = "${main_domain}" +N8N_PORT = "5678" +GENERIC_TIMEZONE = "Europe/Berlin" + +# Variables PostgreSQL +POSTGRES_USER = "${postgres_user}" +POSTGRES_PASSWORD = "${postgres_password}" +POSTGRES_DB = "${postgres_db}" + +# SÉCURITÉ - Encryption (IMPORTANT) +N8N_ENCRYPTION_KEY = "${n8n_encryption_key}" diff --git a/meta.json b/meta.json index f1819cae..64626419 100644 --- a/meta.json +++ b/meta.json @@ -4026,6 +4026,19 @@ "tags": ["home-automation", "nvr", "smart-home", "surveillance"] }, { + "id": "n8n-with-postgres", + "name": "n8n with Postgres", + "version": "latest", + "description": "n8n is an open source low-code platform for automating workflows and integrations with PostgreSQL database for better performance and scalability.", + "logo": "n8n.png", + "links": { + "github": "https://github.com/n8n-io/n8n", + "website": "https://n8n.io/", + "docs": "https://docs.n8n.io/" + }, + "tags": ["automation", "workflow", "low-code", "postgres"] + }, + { "id": "statping-ng", "name": "Statping-NG", "version": "latest", @@ -4038,4 +4051,5 @@ }, "tags": ["monitoring", "status-page"] } -] \ No newline at end of file +] +