Sign inSign up

theorangeone/db-auto-backup

By theorangeone

•Updated about 1 month ago

A script to automatically back up all databases running under docker on a host

Image
0

1.3K

theorangeone/db-auto-backup repository overview

⁠docker-db-auto-backup

A script to automatically back up all databases running under docker on a host

⁠Supported databases

  • MariaDB
  • MySQL
  • PostgreSQL

⁠Installation

This container requires access to the docker socket. This can be done either by mounting /var/lib/docker.sock, or using a HTTP proxy to provide it through $DOCKER_HOST.

Mount your backup directory as /var/backups. Backups will be saved here based on the name of the container. Backups are not dated or compressed.

Backups run daily. To change this, add a cron-style schedule to $SCHEDULE. For more information on the format of the cron strings, please see the croniter documentation on PyPI⁠.

Additionally, there is support for healthchecks.io⁠. $HEALTHCHECKS_ID can be used to specify the id to ping. If you're using a self-hosted instance, set $HEALTHCHECKS_HOST.

⁠Example docker-compose.yml
version: "2.3"

services:
  backup:
    image: ghcr.io/realorangeone/db-auto-backup:latest
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./backups:/var/backups"
    environment:
      - HEALTHCHECKS_ID=id

Tag summary

Content type

Image

Digest

sha256:9952f4824…

Size

76.6 MB

Last updated

about 1 month ago

docker pull theorangeone/db-auto-backup