Container
https://hub.docker.com/_/haproxy
Configuration
/tmp/haproxy/haproxy.cfg
global
maxconn 4096
#stats timeout 30s
#debug
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
log 127.0.0.1 local0
#option httpchk
frontend frontend1
bind :80
mode http
use_backend backend1
backend backend1
mode http
balance roundrobin
option httpchk GET / HTTP/1.1
http-check expect status 400
server www1 172.17.0.2:80 check
server www2 172.17.0.4:80 check
server www3 172.17.0.6:80 check
listen stats
bind :9000
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats refresh 60s
stats show-node
stats auth haproxy:password
stats uri /
Deploy
docker run -d --name haproxy -v /tmp/haproxy:/usr/local/etc/haproxy:ro -p 8080:80 -p 9000:9000 haproxy:latest
docker logs -f haproxy