Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.
/ dev-vm-docker-compose Public archive

docker-compose file for toolkit nginx proxy

Notifications You must be signed in to change notification settings

sfu/dev-vm-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

**** THIS REPOSITORY HAS MOVED ****

This repository has moved to SFU GitHub: https://github.sfu.ca/its/dev-vm-docker-compose.

dev-vm-docker-compose

A simple Docker Compose configuration that orchestrates setting up the tools necessary to use make applications running on a development VM availavle through a public hostname with HTTPS provided by Let's Encrypt.

Usage

  • Clone this repo somewhere on your VM (e.g. in your home directory) as your user, not root.
  • Copy the docker-comopse.local.yml.example file to docker-compose.local.yml
  • Copy the .env.example file to .env
  • Edit docker-compose.local.yml and set the mousehouse environment variables as follows:
    • MM_SERVER: mm.its.sfu.ca
    • MM_USERNAME: a Men & Mice user who has the ability to manage your target DNS zone via the SOAP interface. For LCS, this is LCP-SOAP.
    • MM_PASSWORD: password for MM_USERNAME. For LCS, see the entry for the LCP-SOAP account in KeePass.
    • CNAME_TO: the FQDN of your NSX Load Balancer. This must end with a trailing period (e.g. kipling.lcs-dev.its.sfu.ca.)
    • DNS_ZONE_REF: the internal Men & Mice reference to the DNS zone where CNAME entries will be created. For LCS, consult the LCS DNS Zones page in Confluence for the appropriate entry.
  • Start the compose stack in the background: docker-compose up -d
  • Start a container or compose stack for your application, passing the VIRTUAL_HOST and LETSENCRYPT_HOST environment varibles with your desired hostname. For example:
docker run --rm \
  -e "VIRTUAL_HOST=grahamb-nginx.lcs-dev.its.sfu.ca" \
  -e "LETSENCRYPT_HOST=grahamb-nginx.lcs-dev.its.sfu.ca" \
  -d --name nginx-test \
  nginx:latest

This will:

  • Configure the nginx-proxy container to forward requests on port 80 and 443 to your backend container
  • Generate a certificate using Let's Encrypt and configure the nginx-proxy container to use it
  • Create a DNS CNAME from grahamb-nginx.lcs-dev.its.sfu.ca to the value of the CNAME_TO environment variable you specified

When the container is stopped (e.g. docker stop nginx-test), the revers will happen; the proxy configuration is removed and the CNAME is deleted.

About

docker-compose file for toolkit nginx proxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages