Docker Service to Backup a PostgreSQL Database

I have written a docker service to be used to periodically backup the data of a PostgreSQL Database. This container can be used to be part of a docker stack in a docker-compose.yml file.

version: '3.1'

services:
  ...
  backup:
    image: imixs/backup
    environment:
      SETUP_CRON: "0 3 * * *"
      BACKUP_POSTGRES_USER: "postgres"
      BACKUP_POSTGRES_PASSWORD: "xxxxxxxxxx"
      BACKUP_POSTGRES_HOST: "db"
      BACKUP_LOCAL_ROLLING: "5"
 ....

The service runs a cron job an uploads backup files automatically into a remote backup space via SFTP/SCP.

The Service is published on GitHub and DockerHub.

Leave a Reply

Your email address will not be published. Required fields are marked *