Role for deploying an nginx proxy container based on jwilder/nginx-proxy docker image.
This image provides an optional automatic reverse-proxy for any container started on the same host. See description on Docker Hub for details.
I'm using this with role
gimoh.docker_container which
wraps docker
module and creates/starts containers and can optionally mark
the container to be registered with the proxy provided by this role, as well
as upload SSL/TLS certificates for use by the proxy.
- Docker, I personally use the role angstwad.docker_ubuntu to deploy it
defaults/main.yml
# Path to directory *on the host* where SSL/TLS certificates for the exposed
# services will be stored. This path is mounted as a volume into the
# nginx-proxy container so nginx can access the certificates. The private
# keys and certificates stored there should be named after the FQDN of the
# service with .key and .crt extension respectively.
#
# This role will create and ensure correct permissions on that directory.
#
# See description of the jwilder/nginx-proxy docker image for details.
dnp_nginx_certs_dir: /etc/pki/svc-certs
# Path to directory *on the host* where nginx per-vhost configuration
# file fragments will be stored. This directory will be created and
# group will be set so that users in `docker` group can upload files
# there. This path is then mounted as a volume into the nginx-proxy
# container so nginx can access the files.
dnp_nginx_vhost_dir: /etc/nginx-proxy-vhost.d
- a role to set up docker, as mentioned I use angstwad.docker_ubuntu, there is no hard dependency as this role isn't Ubuntu-specific
This demonstrates how to deploy the image on a base Ubuntu server:
- hosts: servers
sudo: True
roles:
- willshersystems.apt
- angstwad.docker_ubuntu
- gimoh.docker_nginx_proxy
GPLv3
Contact me through GitHub issues, etc.
gimoh