eea / eea.docker.haproxy

HAProxy Docker image with docker links and reload support
https://registry.hub.docker.com/u/eeacms/haproxy/
57 stars 44 forks source link

Feature request: Customize config templates #15

Open jmunson opened 6 years ago

jmunson commented 6 years ago

I noticed you can pass haproxy.cfg into /tmp/haproxy.cfg and it's used as the input template for generating the final haproxy.cfg. This is nice, but unfortunately you're limited in what you can do since the frontend and backend sections are generated based on templates stored directly in the python script.

It would be nice if these templates were moved somewhere else, e.g /tmp/haproxy.d/frontend.cfg, so that I could pass in my own template with customizations.

avoinea commented 6 years ago

@jmunson You can pass your own haproxy.cfg directly @ /etc/haproxy/haproxy.cfg like:

docker run -it --rm -v /path/on/host/to/haproxy.cfg:/etc/haproxy/haproxy.cfg eeacms/haproxy

See https://github.com/eea/eea.docker.haproxy#use-a-custom-configuration-file-mounted-as-a-volume

jmunson commented 6 years ago

Doesn't doing that force you to generate the entire haproxy.cfg manually? My intent was to still have autodiscovery, but tweaking the output format of what it discovers