You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ketudb c01e7d774f
Assume the docker pip bindings are already installed by ansible-role-docker
1 year ago
defaults Assume the docker pip bindings are already installed by ansible-role-docker 1 year ago
tasks switch to using docker-compose with python3 from pip 1 year ago Make HTTPS sidecar optional 2 years ago


This sets up a Docker web server on a CentOS 7 host with the following features:

  • Uses the jwilder/nginx-proxy container as the front-end proxy, which allows for automatic configuration of virtual hosts by environment variables.
  • Optionally uses the 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.

Vars & defaults

docker_web_http_port: 80 # The HTTP port that should be exposed by nginx-proxy
docker_web_https_port: 443 # The HTTPS port that should be exposed by nginx-proxy
docker_web_deploy_key: "{{ role_path }}/../../files/deploy_key" # The path to the SSH public key for the deploy key
docker_web_deploy_key_remote: "/tmp/git.deploy_key" # The path the SSH public key should be copied to on the server
docker_web_build_command: "cd /opt/web-containers && docker compose up -d" # The build command for the container repository - can be a bash script, python etc
  # Yum dependencies
  - python-setuptools
  - python-pip
  - git
  - docker-compose
  # Pip dependencies
  - docker

The following vars have no defaults and must be specified:

docker_web_git_repo: "" # the git repository to build containers from