HAProxy docker container million12/haproxy with ALPN and HTTP/2 support.
Please specify tag when deploying for specific version.
Example:
million12/haproxy:latest
million12/haproxy:1.7.9
- Support for HTTP/2 with ALPN
- CentOS 7 based
- Ability to provide any arguments to haproxy process
Any extra parameters provided todocker runwill be passed directly tohaproxycommand.
For example, if you rundocker run [run options] million12/haproxy -n 1000you pass-n 1000to haproxy daemon. - Pretty lightweight, only ~100M (with OpenSSL and HAProxy compiled from source).
- Default haproxy.cfg provided for demonstration purposes. You can easily mount your own or point to different location using
HAPROXY_CONFIGenv. - Auto restart when config changes
This container comes with inotify to monitor changes in HAProxy config and reload HAProxy daemon. The reload is done in a way that no connection is lost.
HAPROXY_CONFIG
Default: HAPROXY_CONFIG=/etc/haproxy/haproxy.cfg
If you mount your config to different location, simply edit it.
HAPROXY_PORTS
Default: HAPROXY_PORTS=80,443
If you listen to different ports, simply edit it.
docker run -ti --cap-add NET_ADMIN -p 80:80 -p 443:443 million12/haproxy
docker run -d --cap-add NET_ADMIN -p 80:80 -v /my-haproxy.cfg:/etc/haproxy/haproxy.cfg million12/haproxy -n 10000
Note: in this case config is mounted to its default location, so you don't need to modify HAPROXY_CONFIG variable.
docker run -ti million12/haproxy -vv
The default URL for stats is http://CONTAINER_IP/admin?stats with username:password ser to admin:admin.
Author: Marcin ryzy Ryzycki (marcin@m12.io)
Author: Przemyslaw Ozgo (linux@ozgo.info)