diff --git a/templates/haproxy-docker-stack.yml.j2 b/templates/haproxy-docker-stack.yml.j2 index 3b256f8..4aacbd9 100644 --- a/templates/haproxy-docker-stack.yml.j2 +++ b/templates/haproxy-docker-stack.yml.j2 @@ -32,7 +32,18 @@ services: {% else %} mode: host {% endif %} - dns: [127.0.0.11] +{% if docker_swarm_expose_api_via_haproxy %} + - target: {{ docker_swarm_haproxy_swarm_port }} + published: {{ docker_swarm_haproxy_swarm_port }} + protocol: tcp +{% if docker_swarm_haproxy_installation_type == 'mesh' %} + mode: ingress +{% else %} + mode: host +{% endif %} +{% endif %} + +dns: [127.0.0.11] deploy: {% if docker_swarm_haproxy_installation_type == 'keepalive' or docker_swarm_haproxy_installation_type == 'mesh' %} mode: replicated