Public Repository

Last pushed: 7 months ago
Short Description
This container is running haproxy and consul-template. Refreshed by Consul
Full Description
  1. Create your consul template file: /etc/htemplate/template.ctmpl
  2. Run as:
    docker run -d -p 80:80 -v /etc/htemplate/template.ctmpl:/etc/htemplate/template.ctmpl rabotond/haproxy-consultemplate:3.0 [consul host ip address]

It will query your consul agent at the IP you give, and then reloads haproxy config every time when there is a change in Consul. You should edit your template file to match, the service in consul and also the port on which you backend is listening.

Github files:
https://github.com/rabotond/micado_docker/tree/master/haproxy-consulemplate

Template example:

global 
  maxconn 2048
  log 127.0.0.1 local1 notice
defaults
  log global
  timeout connect 5000
  timeout client  36000000
  timeout server  36000000
frontend http-frontend
  bind 0.0.0.0:80
  default_backend endpoint
backend endpoint
  balance roundrobin
  mode http{{range service "da_cluster"}}
  server {{.Node}} {{.Address}}:8080{{end}}
Docker Pull Command
Owner
rabotond