How best backup docker containers including postgre db

I have some VPS servers in the cloud. I backup all of them except one. The one not backed up has an application on it that is installed in Docker. I am familiar with how to backup docker containers but this one also has a postgre db. My question is how I best backup the application containers including the db.
I run Ubuntu 22.04

Regards
Anders, a 70 y.o self taught nerd

Welcome to the forum!

You can either enable PostgreSQL write ahead logs, set up a persistent volume for PG Data and then just back up via the file system (a normal rsync will do), or you can have a separate script or something that runs pg_dumpall, or just pg_dump on the specific DB you need for your program.

Given that PG will be running inside Docker, if you don’t port-forward it to a host port, you’ll have to run the script inside docker and then back up the resulting dump via the file system (again, rsync will do).