Skip to content

Commit c419690

Browse files
author
valentinab25
committed
Update code with new haproxy locations /usr/local/etc/haproxy/haproxy.cfg
1 parent a5da654 commit c419690

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 2021-03-23 (1.8-1.6)
44

55
- Upgrade HAProxy to 1.8.29
6+
- Fixed code to work with new HAProxy configuration location - /usr/local/etc/haproxy/haproxy.cfg
67
- Fix backend port when DNS_ENABLED - refs #24
78

89
## 2019-11-28 (1.8-1.5)

haproxy/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ RUN apt-get update \
1515
&& sed -i '/#$UDPServerRun/c\$UDPServerRun 514' /etc/rsyslog.conf \
1616
&& sed -i '/$UDPServerRun 514/a $UDPServerAddress 127.0.0.1' /etc/rsyslog.conf \
1717
&& sed -i '/cron.*/a local2.* \/proc\/1\/fd\/1' /etc/rsyslog.conf \
18-
&& mv /docker-entrypoint.sh /haproxy-entrypoint.sh
18+
&& mv /usr/local/bin/docker-entrypoint.sh /usr/local/bin/haproxy-entrypoint.sh
19+
20+
COPY src/haproxy.cfg /tmp/
21+
COPY src/configure.py src/track_hosts src/track_dns /
22+
COPY docker-entrypoint.sh /usr/local/bin/
23+
1924

20-
COPY src/haproxy.cfg /tmp/
21-
COPY docker-entrypoint.sh src/configure.py src/track_hosts src/track_dns /

haproxy/Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ all of your backends instead of only the first entry found:
9898

9999
### Use a custom configuration file mounted as a volume
100100

101-
$ docker run -v conf.d/haproxy.cfg:/etc/haproxy/haproxy.cfg eeacms/haproxy:latest
101+
$ docker run -v conf.d/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg eeacms/haproxy:latest
102102

103103

104104
If you edit `haproxy.cfg` you can reload it without having to restart the container:
@@ -111,7 +111,7 @@ If you edit `haproxy.cfg` you can reload it without having to restart the contai
111111
Additionally, you can supply your own static `haproxy.cfg` file by extending the image
112112

113113
FROM eeacms/haproxy:latest
114-
COPY conf.d/haproxy.cfg /etc/haproxy/haproxy.cfg
114+
COPY conf.d/haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
115115

116116
RUN apt-get install...
117117

haproxy/docker-entrypoint.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33

44

5-
# haproxy not directly configured within /etc/haproxy/haproxy.cfg
6-
if ! test -e /etc/haproxy/haproxy.cfg; then
7-
5+
# haproxy not directly configured within /usr/local/etc/haproxy/haproxy.cfg
6+
if ! test -e /usr/local/etc/haproxy/haproxy.cfg; then
87
if [ ! -z "$DNS_ENABLED" ]; then
98
# Backends are resolved using internal or external DNS service
109
touch /etc/haproxy/dns.backends
@@ -65,5 +64,5 @@ service rsyslog restart
6564
#start crontab
6665
service cron restart
6766

68-
exec /haproxy-entrypoint.sh "$@"
67+
exec /usr/local/bin/haproxy-entrypoint.sh "$@"
6968

haproxy/src/configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
else:
217217
accept_proxy = ""
218218

219-
with open("/etc/haproxy/haproxy.cfg", "w") as configuration:
219+
with open("/usr/local/etc/haproxy/haproxy.cfg", "w") as configuration:
220220
with open("/tmp/haproxy.cfg", "r") as default:
221221
conf = Template(default.read())
222222
conf = conf.substitute(

0 commit comments

Comments
 (0)