I have written a docker service to be used for a periodically backup of a PostgreSQL Database. This container can be used to be part of a docker stack in a docker-compose.yml file.
SETUP_CRON: "0 3 * * *"
BACKUP_LOCAL_ROLLING: “5” ....
The service runs a cron job an uploads backup files automatically into a remote backup space via SFTP/SCP.
You can also use this Docker Image to backup a MySQL Database. Just change the environment variable ‘BACKUP_DB_TYPE’: