I'm wondering if there are some best practices to deploy Docker images to Digital Ocean using Terraform.
Because I don't expect much load and don't need failover features etc. I'm not aiming to deploy to kubernetes. At least not for the moment. I just wanna deploy a standalone Docker app.
This leads me to the question whether there are some best practices on how to deploy Docker images via Terraform. To it seemls like I can use (1) App platform or (2) provision a droplet with docker and run the image inside the droplet myself.
I'd prefer to deploy to the App platform. But I don't have a handle on how I can use public images from DockerHub. The App platform itself (via WebIU) supports this. But from the Terraform docs I cannot get a handle on this.
As far as I see it, the app platform is simpler and more straight forward for Docker images. Plus I don't have to setup that many domain-information (I wanna point my existing docs.sommerfeld.io to the App). Downside is that I have to setup a CNAME entry with my Domain Hoster to a .digitalocean.app URL which maybe I cannot do automatically. Plus as said I don't know how to use a public image from DockerHub.
Using the droplet means I would have to do more stuff on my own
- Provisioning the droplet as well as making sure all needed software is installed and my docker image is started
- More domain and CNAME configs on my own
- Setting up https with certs (from let's enctypt) on my own.
So to summarize, here are my questions:
- Do I understand everything I described correctly? Or am I mistaken somewhere?
- Are there some best practices I should follow? How would you tackle my issue? I don't really have a starting point so a push in the right direction would really help me out.
Thanks guys and best regards. Sebastian