The difference is flexibility. With Portainer, switching between Git sync and local editing isn’t seamless : you’re either in one mode or the other.
With a local compose file and a cron job handling Git sync, I can just pause the cron, edit freely, iterate, then commit and push when I’m happy. Same end result, but the workflow feels a lot more natural.
As for the TrueNAS backup point, fair point and good insight, and as they are git backed-up it doesn’t even matter much so let’s get that out of the way then
Well, if you really need git for compose files (for versioning GUI, I suppose), you can just version portainer’s volume directory by git with a kinda same result (I personally won’t do it).
Seems like the tradeoff is
Having the better UI for management. Portainer is definitely better than SSH; it’s debatable for VSCode.
—OR—
Having the better UI for compose versioning. With proper snapshot schedule, you would be able to view/restore a particular compose file. Although, it isn’t as convenient as github/gitlab/gitea.
I’d think VScode with some github plugins using a git setup on TrueNAS could work.
Personally my stack is using Arcane with git pull every 5 mins and renovate is running on GitHub, you can even set Arcane to use a specific directory / dataset and make snapshots locally also, but I mean, once you’re into gitops, there’s tons of options
Updating container images via the Apps interface is not straightforward in my experience (compared to the regular docker compose pull and docker compose up -d approach). However, you can add pull_policy to each service to trigger a pull when you restart the app from the Apps interface. I have tested and confirmed that pull_policy: always works, and I currently have everything set to either daily (most things) or build (Caddy built with the Cloudflare module, I have it commented so it doesn’t re-build on every restart, see below).
One other thing that seems useful that I don’t see mentioned elsewhere, you can create external networks as normal, just access the shell and sudo docker network create caddy-nextcloud-net (before you start the container for the first time). Add the network to your compose file as normal:
services:
caddy:
...
networks:
- nextcloud
# uncomment and restart via Apps interface if an update is needed
# pull_policy: build
networks:
nextcloud:
name: caddy-nextcloud-net
external: true