"Best practice" for backing up docker data?

I’m using docker for a while on a mini Ubuntu Server system 24x7 with local storage.
To avoid data loss I’d like to establish an automation to backup the container volumes on my NAS (NFS and SMB) in the near future.

Is there any best practice/HowTo concerning backing up container volumes to a NAS?
Unfortunalety I’m no Linux-Specialist.

Thanks a lot for helping.

How would you do it without Docker? If it is about an NFS or SMB share, it is about general Linux question (maybe Windows if you have Windows file share). If it is a database that has a specific way to replicate or export /backup data, that is what you need to follow and not just backing up the volume. Also NFS will not be compatible or at least optimal for everything, but that is not Docker-related either.

Thanks a lot for your reply.
What is the “better” solution borg backup or tar?
I would stop all containers before backing up and make a backup to my NFS share.