glim / nginx-consul-template

nginx web/proxy server (extended version) with consul-template bundled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nginx with consul-template bundled

This project is a Docker container for nginx (extended version) bundled with consul-template (v0.9.0) which allows you dynamically create nginx configuration files based on services that are registered in consul. Usually used together with registrator

Getting the container

The container is based on the latest ubuntu image and available on the Docker Index:

$ docker pull andrexus/nginx-consul-template

Using the container

$ docker run -d --name nginx -p 80:80 -p 443:443 andrexus/nginx-consul-template

You may want to replace default consul config file and templates that are located under

/etc/consul-template/config.cfg
/etc/consul-template/templates/

You can mount your config files as extra volumes

$ docker run -d --name nginx \
  -p 80:80 -p 443:443 \
  -v "consul-template.cfg:/etc/consul-template/config.cfg"
  -v "templates:/etc/consul-template/templates" \
  andrexus/nginx-consul-template

Testing with docker-compose

$ docker-compose up

If you are using boot2docker your docker IP might look like this 192.168.59.103. Add the following to your /etc/hosts file.

192.168.59.103  foo.dev
192.168.59.103  bar.dev

License

MIT

About

nginx web/proxy server (extended version) with consul-template bundled

License:MIT License


Languages

Language:Nginx 83.1%Language:Shell 16.9%