fix: use configurable router prefix for traefik services

Replace hardcoded 'hq-api' and '' router names with
configurable hq-api and -web. This ensures
unique identifiers per deployment and avoids conflicts with other
services sharing the same Traefik instance.
This commit is contained in:
Fusion
2026-05-18 10:41:40 +02:00
parent 86245671e7
commit ea9f2e3c98
+10 -10
View File
@@ -77,12 +77,12 @@ services:
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.hq-api.rule=Host(`${API_DOMAIN}`)"
- "traefik.http.routers.hq-api.entrypoints=websecure"
- "traefik.http.routers.hq-api.tls.certresolver=${TRAEFIK_CERT_RESOLVER:-letsencrypt}"
- "traefik.http.services.hq-api.loadbalancer.server.port=8000"
- "traefik.http.middlewares.hq-api-strip.stripprefix.prefixes=/api"
- "traefik.http.routers.hq-api.middlewares=hq-api-strip"
- "traefik.http.routers.${TRAEFIK_ROUTER_PREFIX:-hq}-api.rule=Host(`${API_DOMAIN}`)"
- "traefik.http.routers.${TRAEFIK_ROUTER_PREFIX:-hq}-api.entrypoints=websecure"
- "traefik.http.routers.${TRAEFIK_ROUTER_PREFIX:-hq}-api.tls.certresolver=${TRAEFIK_CERT_RESOLVER:-letsencrypt}"
- "traefik.http.services.${TRAEFIK_ROUTER_PREFIX:-hq}-api.loadbalancer.server.port=8000"
- "traefik.http.middlewares.${TRAEFIK_ROUTER_PREFIX:-hq}-api-strip.stripprefix.prefixes=/api"
- "traefik.http.routers.${TRAEFIK_ROUTER_PREFIX:-hq}-api.middlewares=${TRAEFIK_ROUTER_PREFIX:-hq}-api-strip"
# Web Frontend
web:
@@ -101,10 +101,10 @@ services:
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.${PROXY_WEB_NAME:-hq-web}.rule=Host(`${WEB_DOMAIN}`)"
- "traefik.http.routers.${PROXY_WEB_NAME:-hq-web}.entrypoints=websecure"
- "traefik.http.routers.${PROXY_WEB_NAME:-hq-web}.tls.certresolver=${TRAEFIK_CERT_RESOLVER:-letsencrypt}"
- "traefik.http.services.${PROXY_WEB_NAME:-hq-web}.loadbalancer.server.port=80"
- "traefik.http.routers.${TRAEFIK_ROUTER_PREFIX:-hq}-web.rule=Host(`${WEB_DOMAIN}`)"
- "traefik.http.routers.${TRAEFIK_ROUTER_PREFIX:-hq}-web.entrypoints=websecure"
- "traefik.http.routers.${TRAEFIK_ROUTER_PREFIX:-hq}-web.tls.certresolver=${TRAEFIK_CERT_RESOLVER:-letsencrypt}"
- "traefik.http.services.${TRAEFIK_ROUTER_PREFIX:-hq}-web.loadbalancer.server.port=80"
volumes:
postgres_data: