BretFisher / compose-dev-tls

Easy Traefik TLS proxy plus certificate generation for Docker Compose local development use
The Unlicense
122 stars 23 forks source link
certificates compose developer-tools docker docker-compose proxy ssl-certificates tls traefik

Docker Compose + Traefik TLS Proxy + Self-signed Wildcard Cert

This is a template of the solution I've used in various forms for years for local development. It's easy, flexible, and gives me a near magical solution for always running HTTP apps through docker-compose with TLS, any DNS name, all on a single port with host-header SNI routing via Traefik proxy.

Why would you want this?

Inspired by this great Traefik + Compose walkthrough

Traffic diagram

Overall Steps to Implement

  1. Decide on your URL scheme like *.nip.io, *.localhost, *.vcap.me, or even *.bret.lol
  2. Create and install a self-signed wildcard cert for your browser with cert.sh
  3. Add this docker-compose.yaml and traefik.yaml to your projects, and replace the nginx/httpd example compose services with your apps

Decide on Your URL Scheme

TODO

Create and Install a Self-Signed Wildcard Certificate

TODO

Add Compose+Traefik YAML to Your Projects

TODO

What is bret.lol

It's just a domain I maintain that responds to every hostname *.bret.lol with 127.0.0.1 (localhost). You're welcome to use it, or use one of the others mentioned above.

License

This repository uses The Unlicense