Skip to content

Commit fba3e30

Browse files
committed
feat: Add configurable environment variables to n8n service
Add N8N_HOST, N8N_PORT, N8N_PROTOCOL, N8N_RUNNERS_ENABLED, and NODE_ENV environment variables with sensible defaults. Update Traefik port label to use the N8N_PORT variable for consistency. Remove commented-out port configurations.
1 parent acab4c6 commit fba3e30

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

services-available/n8n.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ services:
1515
mem_limit: ${N8N_MEM_LIMIT:-200g}
1616
networks:
1717
- traefik
18-
#ports:
19-
# - 5678:5678
20-
#expose:
21-
# - 5678
2218
volumes:
2319
- ./etc/n8n/:/home/node/.n8n/
2420
- ./media/n8n/workflows:/home/node/workflows
@@ -40,6 +36,12 @@ services:
4036
- WEBHOOK_URL=https://${N8N_HOST_NAME:-n8n}.${HOST_DOMAIN}/
4137
- GENERIC_TIMEZONE=${TZ}
4238

39+
- N8N_HOST=${N8N_HOST_NAME:-n8n}.${HOST_DOMAIN}
40+
- N8N_PORT=${N8N_PORT:-5678}
41+
- N8N_PROTOCOL=${N8N_PROTOCOL:-https}
42+
- N8N_RUNNERS_ENABLED=${N8N_RUNNERS_ENABLED:-true}
43+
- NODE_ENV=${N8N_NODE_ENV:-production}
44+
4345
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true # Enforce settings file permissions
4446

4547
# Allow these node modules to be imported in Function nodes
@@ -61,7 +63,7 @@ services:
6163
- traefik.http.routers.n8n.entrypoints=websecure
6264
- traefik.http.routers.n8n.rule=Host(`${N8N_HOST_NAME:-n8n}.${HOST_DOMAIN}`)
6365
# - traefik.http.services.n8n.loadbalancer.server.scheme=https # enable if the service wants to connect over https
64-
- traefik.http.services.n8n.loadbalancer.server.port=5678
66+
- traefik.http.services.n8n.loadbalancer.server.port=${N8N_PORT:-5678}
6567
- com.centurylinklabs.watchtower.enable=${N8N_WATCHTOWER_ENABLED:-true}
6668
- autoheal=${N8N_AUTOHEAL_ENABLED:-true}
6769
depends_on:

0 commit comments

Comments
 (0)