Added proxy args in the haproxy Dockerfile
[aai/aai-common.git] / aai-common-docker / aai-haproxy-image / src / main / docker / Dockerfile
1 FROM haproxy:1.7.10-alpine
2
3 # For building the image in a proxy environment if necessary
4 ARG HTTP_PROXY
5 ARG HTTPS_PROXY
6
7 ENV HTTP_PROXY   ${HTTP_PROXY}
8 ENV HTTPS_PROXY  ${HTTPS_PROXY}
9 ENV http_proxy   ${HTTP_PROXY}
10 ENV https_proxy  ${HTTPS_PROXY}
11
12 RUN apk add --no-cache \
13     ca-certificates \
14     curl \
15     openssl \
16     shadow \
17     util-linux && \
18     groupadd haproxy -g 1000 && \
19     adduser -u 1000 -S -D -G haproxy -s /bin/bash haproxy && \
20     chown -R haproxy:haproxy /usr/local/etc/haproxy
21
22 RUN mkdir -p /etc/ssl/certs/ && mkdir -p /etc/ssl/private
23
24 COPY --chown=haproxy aai.pem /etc/ssl/private/aai.pem
25 COPY --chown=haproxy docker-entrypoint.sh /docker-entrypoint.sh
26 COPY --chown=haproxy resolvers.conf /usr/local/etc/haproxy/resolvers.conf
27 COPY --chown=haproxy haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
28
29 RUN chmod +x /docker-entrypoint.sh
30 USER haproxy
31
32 ENTRYPOINT [ "/docker-entrypoint.sh" ]
33 CMD [ "haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg", "-f", "/usr/local/etc/haproxy/resolvers.conf" ]
34 EXPOSE 8443