diff --git a/Dockerfile b/Dockerfile index 78b743b..6be7df4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.3 MAINTAINER Steven Borrelli -ENV CONSUL_TEMPLATE_VERSION=0.12.2 +ENV CONSUL_TEMPLATE_VERSION=0.14.0 RUN apk update && \ apk add bash haproxy ca-certificates zip && \ diff --git a/launch.sh b/launch.sh index 2ad3db0..8767990 100755 --- a/launch.sh +++ b/launch.sh @@ -77,7 +77,7 @@ function launch_haproxy { # be started) [ -f /haproxy/haproxy.cfg ] && rm /haproxy/haproxy.cfg - ${CONSUL_TEMPLATE} -config ${CONSUL_CONFIG} \ + exec ${CONSUL_TEMPLATE} -config ${CONSUL_CONFIG} \ -log-level ${CONSUL_LOGLEVEL} \ -wait ${CONSUL_MINWAIT}:${CONSUL_MAXWAIT} \ -consul ${CONSUL_CONNECT} ${ctargs} ${vars} diff --git a/template/consul.tmpl b/template/consul.tmpl index ccc53f0..6eec8c3 100644 --- a/template/consul.tmpl +++ b/template/consul.tmpl @@ -30,7 +30,7 @@ frontend www # Generated automatically by consul-template {{ range services }} - acl host_{{ .Name }} hdr(host) -i {{ .Name }}.{{ or (env "HAPROXY_DOMAIN") "haproxy.service.consul" }} + acl host_{{ .Name }} hdr_beg(host) -i {{ .Name }}.{{ or (env "HAPROXY_DOMAIN") "haproxy.service.consul" }} use_backend {{ .Name }}_backend if host_{{ .Name }} {{ end }}