From b86a3a7a5adff69db5ba40b498e6ab8e97229d05 Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Fri, 18 Oct 2024 16:23:52 +0100 Subject: [PATCH] when binding to local ports, don't also route via traefik-docker labels --- templates/docker-compose.yml.j2 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 2ff8316..6adb760 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -20,13 +20,16 @@ services: {% if qux_fe_host_bind_port %} ports: - "{{ qux_fe_host_bind_port ~ ':8082' }}" -{% endif %} - depends_on: - - qux-be +{% else %} + expose: + - "8082" labels: traefik.enable: "true" traefik.http.routers.qux-fe.entryPoints: "web_https" traefik.http.routers.qux-fe.rule: "Host(`{{ qux_domain }}`)" +{% endif %} + depends_on: + - qux-be qux-be: restart: always container_name: quant-ux-backend @@ -59,15 +62,18 @@ services: {% if qux_ws_host_bind_port %} ports: - "{{ qux_ws_host_bind_port ~ ':8086' }}" +{% else %} + expose: + - "8086" + labels: + traefik.enable: "true" + traefik.http.routers.qux-ws.entryPoints: "web_https" + traefik.http.routers.qux-ws.rule: "Host(`ws.{{ qux_domain }}`)" {% endif %} links: - qux-be depends_on: - qux-be - labels: - traefik.enable: "true" - traefik.http.routers.qux-ws.entryPoints: "web_https" - traefik.http.routers.qux-ws.rule: "Host(`ws.{{ qux_domain }}`)" networks: default: