Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.56 KB

File metadata and controls

53 lines (39 loc) · 1.56 KB

ethpandaops.general.docker_nginx_proxy

Setup nginx-proxy, docker-gen and acme-companion to handles the automated creation, renewal and use of SSL certificates for proxied Docker containers through the ACME protocol.

Requirements

You'll need docker on the target system. Make sure to install it upfront.

Role Variables

Default variables are defined in defaults/main.yaml

Dependencies

You'll need docker to run this role. One way of installing docker could be via ansible galaxy with the following dependencies set within requirements.yaml:

roles:
- src: geerlingguy.docker
  version: latest
- src: geerlingguy.pip
  version: latest

Example Playbook

Your playbook could look like this:

- hosts: localhost
  become: true
  roles:
  - role: geerlingguy.docker
  - role: geerlingguy.pip
    pip_install_packages:
    - name: docker
  - role: ethpandaops.general.geth
  - role: ethpandaops.general.docker_nginx_proxy

Once you have the setup deployed, you can start any arbitrary webapp container with the VIRTUAL_HOST, VIRTUAL_PORT, LETSENCRYPT_HOST and LETSENCRYPT_EMAIL env vars.

See the example below:

$ docker run --detach \
    --name grafana \
    --env "VIRTUAL_HOST=othersubdomain.yourdomain.tld" \
    --env "VIRTUAL_PORT=3000" \
    --env "LETSENCRYPT_HOST=othersubdomain.yourdomain.tld" \
    --env "[email protected]" \
    grafana/grafana