Skip to content

Commit

Permalink
Changed location of haproxy.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
nmarus committed Feb 14, 2017
1 parent 78c4c82 commit 3276383
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ FROM debian:jessie

RUN apt-get update && apt-get install -y libssl1.0.0 libpcre3 --no-install-recommends && rm -rf /var/lib/apt/lists/*

# Setup HAProxy
ENV HAPROXY_MAJOR 1.6
ENV HAPROXY_VERSION 1.6.9

# see http://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN buildDeps='curl gcc libc6-dev libpcre3-dev libssl-dev make' \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
Expand All @@ -21,6 +20,7 @@ RUN buildDeps='curl gcc libc6-dev libpcre3-dev libssl-dev make' \
USE_ZLIB=1 \
all \
install-bin \
&& mkdir -p /config \
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ docker run -d \
--cap-add=NET_ADMIN
-p 80:80 \
-p 443:443 \
-v /docker/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg \
-v /docker/haproxy/config:/config \
-v /docker/haproxy/letsencrypt:/etc/letsencrypt \
-v /docker/haproxy/certs.d:/usr/local/etc/haproxy/certs.d \
nmarus/haproxy-certbot
Expand All @@ -55,7 +55,7 @@ itself.

The description of the 3 mapped volumes are as follows:

* `/usr/local/etc/haproxy/haproxy.cfg` - The configuration file for HAProxy
* `/config` - The configuration file location for haproxy.cfg
* `/etc/letsencrypt` - The directory that Let's Encrypt will store it's
configuration, certificates and private keys. **It is of significant
importance that you maintain a backup of this folder in the event the data is
Expand Down
2 changes: 1 addition & 1 deletion haproxy-restart.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

nl-qdisc-add --dev=lo --parent=1:4 --id=40: --update plug --buffer
/usr/local/sbin/haproxy -f /usr/local/etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)
/usr/local/sbin/haproxy -f /config/haproxy.cfg -D -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)
nl-qdisc-add --dev=lo --parent=1:4 --id=40: --update plug --release-indefinite
7 changes: 7 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ KEY=${TEMP_DIR}/haproxy_key.pem
CERT=${TEMP_DIR}/haproxy_cert.pem
CSR=${TEMP_DIR}/haproxy.csr
DEFAULT_PEM=${HA_PROXY_DIR}/default.pem
CONFIG=/config/haproxy.cfg

# Check if config file for haproxy exists
if [ ! -e ${CONFIG} ]; then
echo "${CONFIG} not found"
exit 1
fi

# Check if default.pem has been created
if [ ! -e ${DEFAULT_PEM} ]; then
Expand Down
2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ command = /usr/sbin/cron -f
[program:haproxy]
autorestart = unexpected
startsecs = 0
command = bash -c "/usr/local/sbin/haproxy -f /usr/local/etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)"
command = bash -c "/usr/local/sbin/haproxy -f /config/haproxy.cfg -D -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)"

0 comments on commit 3276383

Please sign in to comment.