proxy n8n through traefik

This commit is contained in:
2025-11-05 22:36:52 +00:00
parent 2af45d5ef8
commit a070f44d87

View File

@@ -1,8 +1,6 @@
services: services:
n8n: n8n:
image: n8nio/n8n:latest image: n8nio/n8n:latest
ports:
- 5678:5678
networks: networks:
- homelab - homelab
environment: environment:
@@ -16,7 +14,7 @@ services:
- /home/doc/projects/swarm-data/appdata/n8n:/home/node/.n8n - /home/doc/projects/swarm-data/appdata/n8n:/home/node/.n8n
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck: healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:5678/healthz"] test: [ "CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:5678/healthz" ]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
@@ -32,7 +30,15 @@ services:
memory: 2G memory: 2G
reservations: reservations:
memory: 512M memory: 512M
labels:
- "traefik.enable=true"
- "traefik.swarm.network=homelab"
- "traefik.http.routers.n8n.rule=Host(`n8n.frostlabs.me`)"
- "traefik.http.routers.n8n.entrypoints=websecure"
- "traefik.http.routers.n8n.tls.certresolver=cloudflare"
- "traefik.http.routers.n8n.service=n8n"
- "traefik.http.services.n8n.loadbalancer.server.port=5678"
networks: networks:
homelab: homelab:
external: true external: true