Skip to content

markocelan/docker-lb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-lb

Docker container running HAProxy autoconfigured by consul-template.

You can easily run your own HAProxy loadbalancer.

Example:

$ docker run --name=myapp-loadbalancer \
	-it --rm \
	-p 8000 \
	-p 127.0.0.1::8081 \
	-e APP_NAME=myapp \
	-e CONFIG_TEMPLATE_URL="https://github.com/markocelan/docker-lb/raw/master/in.template.example" \
	-e CONSUL=127.0.0.1:8500 \
	markocelan/docker-lb
  • port 8000 is where your upstream services get balanced
  • port 8081 is where you can see your HAProxy status.

APP_NAME is needed only when you are using example template. It is used so consul-template knows which service you are trying to balance.

Using example template

If you want you can use example template for HTTP load balancer. Simply set APP_NAME environment variable to a consul service name. I.e. if your application is registred as 'myapplication' in consul then use '-e APP_NAME=myapplication' switch when running your docker container.

About

Docker container running HAProxy autoconfigured by consul-template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages