https://chattes.github.io/Setting-SSL-Docker/

A Micro Services Architecture

In my proudction server for cheappr.io I am running multiple containers.

My Pain , My Gain!

All these were pretty starigh forward to setup and get running. But can everything be so easy, I wanted my site to be secure and configure with SSL.

I decided to use the excellent letsencrytpt. But it was a real pain to setup for me. Mind you I wanted a dockerized container running the letsencrypt certbot as well to automatically renew the certificates.

I could not and still don’t understand it fully but finally got a solution which is so elegant! Yippie.

How ??

I used the following 2 containers to get the architecture up and running

jwilder/nginx-proxy JrCs/docker-letsencrypt-nginx-proxy-companion

Let me put it in a picture how the solution looks now

Architecture:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/afa2acd0-25a7-4c48-a1af-2366e2979f55/Cheapp20Arch.png

This makes it better as in the future I can add another container and just forward request to a new sub domain using the nginx reverse proxy.

The repo is excellently documented and pretty straigh forward to get up and running. I had struggled before this with other SSL certbot containers, and they worked inconsistently for me.