FROM keks/ubuntu
MAINTAINER Jan M. <[email protected]>
# setup HAProxy with keepalived
ENV DEBIAN_FRONTEND noninteractive
RUN add-apt-repository ppa:vbernat/haproxy-1.5 && \
apt-get update && \
apt-get install haproxy -y && \
rm -rf /var/lib/apt/lists/*
ADD run.sh /haproxy-start
# in case of custom http error pages (404/403/...)
# and haproxy.conf mounted to /data
VOLUME ["/haproxy-override", "/data"]
# Define working directory.
WORKDIR /etc/haproxy
# Define default command.
CMD ["bash", "/haproxy-start"]
# Expose ports.
EXPOSE 80 443 4369 5670 15670
#!/bin/bash
HAPROXY="/etc/haproxy"
OVERRIDE="/haproxy-override"
PIDFILE="/data/haproxy.pid"
CONFIG="/data/haproxy.conf"
ERRORS="errors"
cd "$HAPROXY"
# Symlink errors directory
if [[ -d "$OVERRIDE/$ERRORS" ]]; then
mkdir -p "$OVERRIDE/$ERRORS"
rm -fr "$ERRORS"
ln -s "$OVERRIDE/$ERRORS" "$ERRORS"
fi
# Symlink config file.
if [[ -f "$OVERRIDE/$CONFIG" ]]; then
rm -f "$CONFIG"
ln -s "$OVERRIDE/$CONFIG" "$CONFIG"
fi
exec haproxy -f "$CONFIG" -p "$PIDFILE" -sf $(cat ${PIDFILE})
Content type
Image
Digest
sha256:da1f46c2e…
Size
141.4 MB
Last updated
about 11 years ago
docker pull keks/haproxy