diff --git a/files/docker-entrypoint.sh b/files/docker-entrypoint.sh new file mode 100755 index 0000000..581edc9 --- /dev/null +++ b/files/docker-entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = 'haproxy' ]; then + # if the user wants "haproxy", let's use "haproxy-systemd-wrapper" instead so we can have proper reloadability implemented by upstream + shift # "haproxy" + set -- "$(which haproxy-systemd-wrapper)" -p /run/haproxy.pid "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/files/haproxy.sh b/files/haproxy.sh new file mode 100755 index 0000000..f3623c1 --- /dev/null +++ b/files/haproxy.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [[ ! -z "${DEBUG_MODE}" ]]; then + rpm -q syslog-ng + if [[ $? -ne 0 ]]; then + dnf -y --setopt=tsflags=nodocs install syslog-ng && \ + dnf -y clean all + syslog-ng + fi + +fi + +# Run haproxy binary +/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg