Browse Source

Make HTTPS sidecar optional

master
ketudb 1 year ago
parent
commit
698c081bb3
Signed by: ketudb <nerd@caffeinewitch.tech> GPG Key ID: 8BE60969796AE13F
3 changed files with 26 additions and 4 deletions
  1. +2
    -2
      README.md
  2. +3
    -1
      defaults/main.yml
  3. +21
    -1
      tasks/main.yml

+ 2
- 2
README.md View File

@@ -3,7 +3,7 @@
This sets up a Docker web server on a CentOS 7 host with the following features:

- Uses the [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) container as the front-end proxy, which allows for automatic configuration of virtual hosts by environment variables.
- Uses the [JrCs/docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) container for LetsEncrypt, which allows for automatic issuance & renewals of LetsEncrypt certificates, configured with environment variables. It also automatically updates the vhosts in the `nginx-proxy` container with the configuration for the certificates.
- Optionally uses the [JrCs/docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) container for LetsEncrypt, which allows for automatic issuance & renewals of LetsEncrypt certificates, configured with environment variables. It also automatically updates the vhosts in the `nginx-proxy` container with the configuration for the certificates. (when `docker_web_setup_https_container: true`)
- Automatically pulls a repository from Git container a docker-compose file (or other script) which is used to configure the containers and environment variables.
- It uses an SSH deploy key to accomplish this.

@@ -26,4 +26,4 @@ This sets up a Docker web server on a CentOS 7 host with the following features:

The following vars have no defaults and **must** be specified:

docker_web_git_repo: "git@github.com:somebody/web-containers.git" # the git repository to build containers from
docker_web_git_repo: "git@github.com:somebody/web-containers.git" # the git repository to build containers from

+ 3
- 1
defaults/main.yml View File

@@ -10,4 +10,6 @@ docker_web_yum_dependencies:
- git
- docker-compose
docker_web_pip_dependencies:
- docker
- docker

docker_web_setup_https_container: true

+ 21
- 1
tasks/main.yml View File

@@ -12,7 +12,7 @@
tags:
- pip

- name: Setup nginx reverse proxy
- name: Setup nginx reverse proxy with https support
docker_container:
name: http-proxy
published_ports:
@@ -29,6 +29,25 @@
- /usr/share/nginx/html
env:
ENABLE_IPV6: "true"
when: docker_web_setup_https_container is true
tags:
- nginx

- name: Setup nginx reverse proxy without https support
docker_container:
name: http-proxy
published_ports:
- 0.0.0.0:{{ docker_web_http_port }}:80
restart_policy: always
image: jwilder/nginx-proxy
labels:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /etc/nginx/vhost.d
- /usr/share/nginx/html
env:
ENABLE_IPV6: "true"
when: docker_web_setup_https_container is false
tags:
- nginx

@@ -42,6 +61,7 @@
volumes_from:
- http-proxy
image: jrcs/letsencrypt-nginx-proxy-companion
when: docker_web_setup_https_container is true
tags:
- nginx



Loading…
Cancel
Save