← Back to context

Comment by utopiah

4 hours ago

Why VMs over containers?

Mostly to have stronger separation, I'm sure the person who prefers VM-per-project also has their own reasons.

I just have a few large VMs, each a different environment with slightly different ways how I treat them - the prod ones get more due diligence and being careful, whereas all of the dev ones (including where I host Gitea, Woodpecker CI, Nextcloud, Kanboard, Uptime Kuma etc.) I mess around with the configuration in and do restarts more often. I personally used to run a Docker Swarm cluster, but now just use Docker Compose with Ansible directly, still multiple stacks per each of those servers, dead simple

So my setup ended up being:

  * VPS / VMs - an environment, since don't really need replication/distributed systems at my scale
  * container stack (Compose/Swarm) - a project, with all its dependencies, though ingress is a shared web server container per environment
  * single container - the applications I build, my own are built on top of a common Ubuntu LTS base more often than not, external ones (like Nextcloud and tbh most DBs) are just run directly

Works very well, plus containers allow me to easily have consistent configuration management, networking, resource limits and persistent storage.