-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
18 lines (15 loc) · 907 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Inspired by https://github.com/camptocamp/docker-haproxy-consul
FROM haproxy:2.0-alpine
ARG CONSUL_TEMPLATE_VERSION=0.18.1
ENV CONSUL_ADDRESS localhost:8500
ADD https://releases.hashicorp.com/consul-template/${CONSUL_TEMPLATE_VERSION}/consul-template_${CONSUL_TEMPLATE_VERSION}_linux_amd64.zip /
RUN apk update && \
apk add --no-cache --quiet zip && \
unzip /consul-template_${CONSUL_TEMPLATE_VERSION}_linux_amd64.zip &&\
mv /consul-template /usr/local/bin/consul-template && \
rm -rf /consul-template_${CONSUL_TEMPLATE_VERSION}_linux_amd64.zip && \
apk del zip
RUN mkdir -p /etc/consul-template /etc/haproxy
COPY haproxy.cfg.tpl /etc/consul-template/haproxy.cfg.tpl
COPY haproxy.sh /haproxy.sh
CMD /usr/local/bin/consul-template --consul-addr ${CONSUL_ADDRESS} -template="/etc/consul-template/haproxy.cfg.tpl:/etc/haproxy/haproxy.cfg" -exec /haproxy.sh -exec-reload-signal SIGHUP