diff --git a/examples/n8n/.env b/examples/n8n/.env index 733d9dccd..d0128c58d 100644 --- a/examples/n8n/.env +++ b/examples/n8n/.env @@ -1,6 +1,22 @@ +## database settings POSTGRES_USER=postgres POSTGRES_PASSWORD=MySecureRootDbUserPassword POSTGRES_DB=n8n - POSTGRES_NON_ROOT_USER=n8n POSTGRES_NON_ROOT_PASSWORD=MySecureDatabaseUserPassword + +## application settings +N8N_NODE_ENV=production +N8N_TZ=Europe/Berlin + +## tls proxy settings +N8N_HOST=n8n.example.com +N8N_PROTOCOL=http +N8N_WEBHOOK_URL=https://n8n.example.com/ + +## npm extra options +# this will install additional npm packages during container start +EXTRA_NODE_MODULES=lodash + +# this will whitelist additional npm packages +NODE_FUNCTION_ALLOW_EXTERNAL=lodash \ No newline at end of file diff --git a/examples/n8n/README.md b/examples/n8n/README.md index a4b83bdb6..fb68bc095 100644 --- a/examples/n8n/README.md +++ b/examples/n8n/README.md @@ -19,9 +19,12 @@ mv init-database.sh /mnt/docker-volumes/n8n/. # fix permissions sudo chown -R 0:1000 /mnt/docker-volumes/n8n/ sudo chmod -R 775 /mnt/docker-volumes/n8n/ + +# adjust environment variables +nano .env ```` -Afterwards, you can proceed spawning up the docker compose stack with: +Afterwards, you can proceed spawning up the docker compose stack: ```` docker compose up -d diff --git a/examples/n8n/docker-compose.yml b/examples/n8n/docker-compose.yml index 84888e620..313780860 100644 --- a/examples/n8n/docker-compose.yml +++ b/examples/n8n/docker-compose.yml @@ -29,13 +29,22 @@ services: hostname: n8n restart: unless-stopped environment: + # database settings - DB_TYPE=postgresdb - DB_POSTGRESDB_HOST=n8n-db - DB_POSTGRESDB_DATABASE=${POSTGRES_DB} - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER} - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD} - - EXTRA_NODE_MODULES=lodash - - NODE_FUNCTION_ALLOW_EXTERNAL=lodash + # application settings + - NODE_ENV=${N8N_NODE_ENV} + - GENERIC_TIMEZONE=${N8N_TZ} + # tls proxy settings + - N8N_HOST=${N8N_HOST} + - N8N_PROTOCOL=${N8N_PROTOCOL} + - WEBHOOK_URL=${N8N_WEBHOOK_URL} + # npm extra options + - EXTRA_NODE_MODULES=${N8N_EXTRA_NODE_MODULES} + - NODE_FUNCTION_ALLOW_EXTERNAL=${N8N_NODE_FUNCTION_ALLOW_EXTERNAL} ports: - 5678:5678 expose: @@ -44,6 +53,7 @@ services: - n8n-db volumes: - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/n8n/storage:/home/node/.n8n + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/n8n/files:/files depends_on: n8n-db: condition: service_healthy