Nginx image with configuration driven by Consul-Template
1.1K
An extendable docker image that runs Nginx with its configuration driven by Consul via Consul-Template.
This is meant to act as a base image - actual Nginx configuration should be managed in derived images with config files and/or consul templates.
You must set CONSUL_HTTP_ADDR in order for consul-template to render
any templates when the container runs. Any supported consul-template environment
variables can be used, such as:
See the consul-template documentation for details about these settings.
Additionally, the following environment variables can be used to adjust consul-template:
/etc/nginx/nginx.conf.ctmpl/etc/nginx/templates.derrBy default, the upstream nginx base image contains a default global/http
configuration in /etc/nginx/nginx.conf and server (virtual host)
configuration in /etc/nginx/conf.d/default.conf. In most cases neither of
these are sufficient and should be overwritten.
If the file ${NGINX_CONF_TEMPLATE} exists at runtime, it will be registered
as a consul template and rendered to /etc/nginx/nginx.conf,
effectively overwriting the default main configuration. You can also override
the default configuration without a template by simply adding your own
/etc/nginx/nginx.conf in a derived image.
Any files contained in the ${NGINX_TEMPLATE_DIR} directory that end in .ctmpl
will be registered as a consul template at runtime. The .ctmpl extension
will be stripped and rendered to the /etc/nginx/conf.d/ directory.
For example, ${NGINX_TEMPLATE_DIR}/default.conf.ctmpl will be rendered to
/etc/nginx/conf.d/default.conf.
Additional Nginx customizations can be made by adding .conf files to
/etc/nginx/conf.d (these files will not be rendered by consul-template).
For additional control over the configuration of consul-template, valid HCL
or JSON consul-template config(s) can be added to /etc/consul-template.d/.
Content type
Image
Digest
Size
8.9 MB
Last updated
about 9 years ago
docker pull steadyserv/nginx-consul