Multiple compose file, each in their own directory for a stack of services. Running Lemmy? It goes to ~/compose_home/lemmy
, with binds for image resized and database as folders inside that directory. Running website? It goes to ~/compose_home/example.com
, with its static files, api, and database binds all as folders inside that. Etc etc. Use gateway reverse proxy (I prefer Traefik but each to their own) and have each stack join the network to expose only what you’d need.
Back up is easy, snapshot the volume bind (stop any service individually as needed); moving server for specific stack is easy, just move the directory over to a new system (update gateway info if required); upgrading is easy, just upgrade individual stack and off to the races.
Pulling all stacks into a single compose for the system as a whole is nuts. You lose all the flexibility and gain… nothing?
I scream test myself… kidding aside, I try to pin to major versions where possible —
Postgres:16-alpine
for example will generally not break between updates and things should just chip along. It’s when indie devs not tagging anything other thanlatest
or adhere to semantic versioning best practices where I keep watchtower off and update once in a blue moon manually as a result.