Skip to content

Scheduled PostgreSQL Backups using WAL-G packaged as Docker Image

Notifications You must be signed in to change notification settings

tma/database-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized Database Backup

Automated database backup solution using WAL-G.

Usage

version: '3'
services:
  backup:
    build: .
    environment:
      WALG_FILE_PREFIX: /backups
      PGHOST: database
      PGPORT: 5432
      PGUSER: postgres
      PGPASSWORD: password
      PGDATABASE: mydb
      CRON_SCHEDULE: "0 * * * *"
    volumes:
      - db-data:/var/lib/postgresql/data:ro
      - backups:/backups

volumes:
  db-data:
    external: true
  backups:

Environment Variables

  • WALG_FILE_PREFIX: Backup storage location
  • PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE: PostgreSQL connection details
  • MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE: MySQL connection details
  • CRON_SCHEDULE: Backup frequency (cron format)

Operation

Hourly backups by default, retaining only the latest full backup. Empty directories are automatically cleaned up.

About

Scheduled PostgreSQL Backups using WAL-G packaged as Docker Image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages