Sign inSign up

monusiddiki/mysql-backup:latest

Manifest digest

sha256:a338432d47d81a24eae8e4eee7f4ecf31d5117c5585200332396bcda28d4c87b

Last pushed

2 months by monusiddiki

Type

Compose

Manifest digest

sha256:a338432d47d81a24eae8e4eee7f4ecf31d5117c5585200332396bcda28d4c87b

Compose file content

services:
  mysql_backup:
    image: databack/mysql-backup:v2
    container_name: mysql_backup
    restart: always
    environment:
      # Timezone configuration
      TZ: Asia/Kathmandu
      
      # Connects directly to the mysql service over the internal network
      DB_SERVER: ${MYSQL_HOST}
      DB_USER: ${MYSQL_USER}
      DB_PASS: ${MYSQL_PASSWORD}
      
      # Select specific database(s) or use 'all' for all databases
      DB_NAMES: ${MYSQL_DB:-"all"}
      
      # Cron schedule (Note: databack uses CRON_SCHEDULE instead of SCHEDULE)
      CRON_SCHEDULE: ${BACKUP_CRON}
      
      # Extra flags passed directly to the mysqldump binary
      DB_DUMP_OPTIONS: ${MYSQLDUMP_OPTS:-"--single-transaction --quick"}
      
      # Boolean value: setting this to true starts a backup when the container first starts
      RUN_ON_START: ${BACKUP_ON_START}
      
      # Advanced multi-tier retention settings matching your original setup
      BACKUP_RETAIN_DAYS: ${BACKUP_KEEP_DAYS}
      BACKUP_RETAIN_WEEKS: ${BACKUP_KEEP_WEEKS}
      BACKUP_RETAIN_MONTHS: ${BACKUP_KEEP_MONTHS}
      
    volumes:
      # Mounts a local host directory to store the actual compressed backup files
      - ./mysql-backups:/db
      
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "3"

Docker commands

docker compose -f oci://monusiddiki/mysql-backup:latest up

Use the above command to pull and run the Compose file. Learn more⁠.

Images used

Image

Back up mysql databases to... anywhere!


Pulls

10M+

Stars

131

Last Updated

3 days