docker-haproxy-k8s/Dockerfile

23 lines
697 B
Docker
Raw Permalink Normal View History

FROM haproxy:2.9.0-alpine3.18
LABEL architecture="$TARGETPLATFORM" \
license="beerware" \
name="haproxy" \
summary="Alpine based haproxy container" \
mantainer="antoinroux@hotmail.fr"
USER root
RUN apk add --no-cache gettext
COPY --chown=haproxy:haproxy haproxy.template.cfg /etc/haproxy/haproxy.template.cfg
COPY --chmod=750 --chown=haproxy:haproxy init.sh /
EXPOSE 6443 9000
ENV ADMIN_PASSWORD ""
ENV PEER_0 192.168.2.3:6443
ENV PEER_1 192.168.2.25:6443
ENV PEER_2 192.168.2.19:6443
# extract from https://github.com/docker-library/haproxy/blob/master/Dockerfile.template#L166
ENTRYPOINT ["/init.sh", "docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/etc/haproxy/haproxy.cfg"]