A bit more contrived than copying the volume but you don't need to shut down the server. There's probably some scripts out there for doing this in a structured way but I usually do it more or less manually/use a bash script.
[0]: https://www.postgresql.org/docs/current/app-pgdump.html
docker compose down && docker compose run backup && docker compose up -d
The restore procedure is the same, you restore the composefile through restic on the host and then `docker compose run backup restic restore latest --exclude "/data/self/*" --target /`
I find it's fast enough because restic is incremental, but if you can set this up on a filesystem with snapshots that would be a great option too.
Restic takes a bit of fiddling around too. I mount a prepared ssh config, a known hosts file and a private key.