mirror of
https://github.com/acedanger/docker.git
synced 2025-12-06 01:10:11 -08:00
Add Docker Compose configuration for n8n service and example environment file
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -23,3 +23,4 @@ pdf/stirling/latest/config/*.db
|
|||||||
|
|
||||||
# ignore environment files
|
# ignore environment files
|
||||||
.env
|
.env
|
||||||
|
memos/.memos/memos_prod.db
|
||||||
|
|||||||
9
n8n/.env.example
Normal file
9
n8n/.env.example
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
POSTGRES_DB=nodemotion
|
||||||
|
POSTGRES_USER=nodemotion
|
||||||
|
# openssl rand -base64 18
|
||||||
|
POSTGRES_PASSWORD=
|
||||||
|
|
||||||
|
POSTGRES_NON_ROOT_USER=
|
||||||
|
# openssl rand -base64 18
|
||||||
|
POSTGRES_NON_ROOT_PASSWORD=
|
||||||
44
n8n/compose.yml
Normal file
44
n8n/compose.yml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
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
|
||||||
Reference in New Issue
Block a user