
Docker on EC2 with Terraform
Why this project I was preparing a workshop and needed to expose a url with a specific interface, sparing participants from installing docker or anything else on their machines. I built the workshop locally with docker compose, which is one of the ways to develop and test locally: it works, it's fast, it's reproducible. And then? Then you need to move everything to the cloud. And as a lazy developer, why not use that same docker compose? The point isn't running Docker in the cloud - it's everything around it: HTTPS, custom domain, machine access, data backups, and the ability to rebuild or tear it all down with one command. With IaC you can manage HTTPS, custom domain, backups, access and cleanup smoothly: everything in one place, versioned, reproducible. Without IaC, you start from scratch every time. The usual options: Manual EC2 setup : SSH in, install Docker, configure nginx, certbot, and pray. Slow, fragile, and hard to reproduce. ECS/Fargate : task definition, service discovery,
Continue reading on Dev.to
Opens in a new tab



