To have automated dockerized database backup just add these lines below on your docker-compose file and adjust env variables accordinlgy
Note: make sure you have the right backup folder, database volume and network set as per your project
db-backup:
image: mariadb-backup:latest
restart: unless-stopped
volumes:
- /backups:/backups
- db-data:/var/lib/mysql
environment:
- ENV=environment
- CRON_FREQUENCY=0 2 * * *
- DB_HOST=db_host
- DB_NAME=database_name
- DB_USERNAME=username
- TIMEZONE=Pacific/Auckland
networks:
app-bridge:
Content type
Image
Digest
Size
14 MB
Last updated
almost 7 years ago
docker pull webtoolsdev/mariadb-backup