Next up how can I handle SSL cert c. 1
Santiago says How can I handle SSL cert for engine X and local environment. 2
Dev environment to prod for HTPs yes so. 3
Locally you just need to create your own certs if you're going to a local development then what I would 4
probably do is use engine X or traffic or something like that inside your compose file and that way 5
you can have your URLs and parcels back to your app right and you can look up Let's Encrypt Let's Encrypt 6
has a good article on certificates for local hosts and they give you the whole background on why you 7
shouldn't get wild cards or why you shouldn't go use a lets encrypt for local host traffic and that 8
you really should just generate them store them on your local machine and bind mount them in your containers 9
at runtime use Docker compose to bind mount those certificates into your running containers and that 10
way they always have trust a certificate. 11
Now if you use the same certificate all the time and this is what I do then you can store it outside 12
your project somewhere on your local machine and then you can tell your browsers to trust it. 13
So if you're using the name that matches the certificate. 14
If you create the certificates with the name local host on your local machine and then you use those 15
in your compose file for your proxies and then you tell your browsers to trust that certificate. 16
Then you have you know you have a great local deployment environment that is always going to work. 17
It's not going to give you warnings and your browsers will trust it you don't necessarily need to go 18
get third party certificates because those don't work for local machines. 19
They're not designed for local machines and I wouldn't easily share these certificates out there's no 20
reason to really share them they're easy to create. 21
Know so it's to me it's kind of like an SS HQ. 22
Just keep it on your local machine. 23
You might even just keep it in your dot SSH folder or create one called Dot cert in your profile 24
on your local machine and just storm there and link to them in your compose files so that you will always 25
have them when you need them inside of your proxies or any web servers that you want to have SSL locally. 26
Now of course in production that's a totally different deal. 27
If you're talking about Docker swarm for instance I like to use Let's Encrypt with traffic which traffic 28
is a front end proxy that works like engine X in that way and I have a repo called dogs versus cat that 29
has an example of that. 30
I'll also throw that in here for you. 31
That repo has an example of how to use a traffic proxy with Let's Encrypt so it will automatically go 32
get your certificates and bring them back. 33
Now if you want to go buy your own certificates like what we traditionally used to do. 34
That's fine too. 35
You could store those in secrets in and swarm using Cuban eddies you could also storm and secrets and 36
that way they'd be available for whatever containers you need. 37
Hopefully that helps. 38
And good question.