This is build from the dockerfile/haproxy but adds some environment parsing and linked containers to allow the ha proxy to automatically setup up load balanced clusters based on the host name.
Environment Variables:
HACLUSTER_CLUSTERNAME : The host names of the clusters
CLUSTERNAME_PORT: The port exposed by the linked container.
CLUSTERNAME_LINKS: A comma separated list of linked containers that will be in the load balanced cluster.
Example:
docker run -p 80:80 -t -i --link test1:test1 --link test2:test2 --link test3:test3 -e HACLUSTER_TEST1=test1.domain.com -e HACLUSTER_TEST2=test2.domain.com -e TEST1_CLUSTER_PORT=80 -e TEST2_CLUSTER_PORT=8080 -e TEST1_CLUSTER_LINKS=TEST1 -e TEST2_CLUSTER_LINKS=TEST2,TEST3 mjgillespie/haproxy
The example flow creates 3 links, test1, test2, and test 3 and puts them into 2 clusters: test1.domain.com and test2.domain.com.
Next up will be adding an overridable configuration.
Content type
Image
Digest
sha256:473b26c46…
Size
145.4 MB
Last updated
almost 11 years ago
docker pull mjgillespie/haproxy