This container is a Nginx load balancer with upstream automatic update using Consul Template.
671
#Nginx Load Balancer With Consul Template
Dockerfile for Nginx load balancer with upstream automatic update using Consul Template
You can pull laatest built image from DockerHub:
docker pull cloudhero/nginx-consul-loadbalancer
Run image:
docker run -it -e "CONSUL=$DOCKER_IP:8500" -e "SERVICE=queryname" -p 80:80 cloudhero/nginx-consul-loadbalancer
CONSUL is the IP address of your Consul service, SERVICE is the query sent to consul which will be distributed across.
Build with:
docker build -t nginx-consul-loadbalancer .
Run with:
docker run -it -e "CONSUL=$DOCKER_IP:8500" -e "SERVICE=queryname" -p 80:80 nginx-consul-loadbalancer
CONSUL is the IP address of your Consul service, SERVICE is the query sent to consul which will be distributed across.
##Customize nginx template
You can update nginx-vhost.conf.ctmpl based on your needs as loong as you keep the same query parameters.
Currently this image has been tested and works well with Consul Template version 0.5.1
Latest version of Consul Template returs {{.Address}} query from {{.ServiceAddress}} which provides wrong upstream IP address.
References: here
Content type
Image
Digest
Size
98.3 MB
Last updated
over 10 years ago
docker pull cloudhero/nginx-consul-loadbalancer