Sign inSign up

markocelan/docker-lb

By markocelan

Updated over 11 years ago

Image
0

2.3K

markocelan/docker-lb repository overview

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.

Tag summary

Content type

Image

Digest

sha256:36be20ab2

Size

7 MB

Last updated

over 11 years ago

docker pull markocelan/docker-lb