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

WIP: utilizing letsencrypt #4

Open zaherg opened 4 years ago

zaherg commented 4 years ago

This PR will utilize letsencrypt to create a valid SSL certificate that you can use.

Requirements:

  1. Domain name
  2. Make sure your domain is controlled by one of the supported DNS providers https://docs.traefik.io/https/acme/#providers
  3. Change the Domain DNS to 127.0.0.1
  4. Make sure to edit docker-compose.yml file to match your

for example, if you are using DigitalOcean there is no need to change anything, just make sure to create a new file .env which contain the following information:

DO_AUTH_TOKEN=the-token-you-get-from-digitalocean
MAIN_DOMAIN=yourdomain.com
SANS_DOMAIN=*.yourdomain.com

I am sure this PR needs a lot of enhancing but this is just a starting point.

#Ref: a longer example can be found here https://gist.github.com/zaherg/26cb8f41073708d4b94239f0aaf3bb79

BretFisher commented 4 years ago

Thanks, @zaherg. This would be a nice 2nd example of how to use this repository if you have your own domain name to use, but that changes the use case of this repository because I'm assuming everyone doesn't. How would you suggest we accommodate both scenarios?

zaherg commented 4 years ago

@BretFisher how about having two folders, one with your code since it will use a self-signed SSL certificate and the second one for letsencrypt

zaherg commented 4 years ago

@BretFisher how about we just add a link to my repo instead of editing your repo https://github.com/zaherg/letsencrypt-for-local-development ?

BretFisher commented 4 years ago

Sounds good. I haven't spent enough time to come up with a easy alternative that allows both approaches. I do like keeping your PR there as a way for users to see the difference in approaches so I'll keep that open.