Sign inSign up

yanana/nginx-consul-template

By yanana

Updated over 10 years ago

Image
0

2.1K

yanana/nginx-consul-template repository overview

docker-nginx-consul-template

Consul Template powered Nginx container.

Useage

This container is not intended to be used by itself. You have to create a container which inherits this. E.g., with a configuration template app.conf.ctmpl Dockerfile would be:

FROM yanana/nginx-consul-template

ADD app.conf.ctmpl /etc/consul-templates/app.conf.ctmpl

CMD ["my_init"]

And the template:

upstream app {
  least_conn;
  {{range service "some-cool-app"}}server {{.Address}}:{{.Port}} max_fails=3 fail_timeout=60 weight=1;
  {{else}}server 127.0.0.1:65535; # force a 502{{end}}
}

And given running docker-consul container named 'consul':

docker run -d \
  -v /somewhere/to/put/logs:/var/log/nginx:rw \
  --link consul:consul \
  -p port-to-publish-nginx:80 \
  --name container-name \
  -e "SERVICE_NAME=service-name-to-register-to-consul" \
  -e "SERVICE_TAGS=tag1,tag2,tag3" \
  yanana/nginx-consul-template

That's all :sushi:

Tag summary

Content type

Image

Digest

sha256:bf5ee3019

Size

97 MB

Last updated

over 10 years ago

docker pull yanana/nginx-consul-template