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