Public Repository

Last pushed: 2 years ago
Short Description
Ubuntu 14.04.2 LTS / HAProxy 1.5.14
Full Description

Ubuntu 14.04.2 LTS / HAProxy 1.5.14

Dockerfile

FROM keks/ubuntu
MAINTAINER Jan M. <keks@keksfabrik.eu>
# 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

accompanying run.sh (/haproxy-start)

#!/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})
Docker Pull Command
Owner
keks

Comments (0)