Nginx and Let’s Encrypt with Docker in Less Than 5 Minutes

<p>The other day, I wanted to&nbsp;<em>quickly</em>&nbsp;launch an nginx server with Let&rsquo;s Encrypt certificates. I expected the task to be easy and straightforward. Turns out: I was wrong, it took a significant amount of time and it&rsquo;s quite a bit more complicated.</p> <p>Of course, in the grand scheme of things, it&nbsp;<em>is</em>&nbsp;pretty straightforward. But there are a couple of details you need to be aware of. The goal of this guide is to help you build a docker-compose setup that runs nginx in one container and a service for obtaining and renewing HTTPS certificates in another.&nbsp;<strong>Whether you&rsquo;re using nginx as a proxy for your web app or just for serving static files, this guide is for you.</strong></p> <blockquote> <p>TL;DR: The full code from this guide is&nbsp;<a href="https://github.com/wmnnd/nginx-certbot" rel="noopener ugc nofollow" target="_blank">available on GitHub</a>.</p> </blockquote> <h2>Quick Reminder: What is docker-compose?</h2> <p><a href="https://docs.docker.com/compose/" rel="noopener ugc nofollow" target="_blank"><em>docker-compose</em></a>&nbsp;is a tool for defining containers and running them. It&rsquo;s a great choice when you have multiple interdependent containers but you don&rsquo;t need a full-blown container cluster like Kubernetes.</p> <p><a href="https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71"><strong>Read More</strong></a></p>
Tags: Encrypt Docker