mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 21:33:28 +01:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
version: '2'
|
|
|
|
networks:
|
|
example-db-network:
|
|
name: example-db-network
|
|
|
|
services:
|
|
example-db:
|
|
hostname: example-db-host
|
|
container_name: example-db
|
|
image: mariadb:latest
|
|
ports:
|
|
- 13306:3306
|
|
volumes:
|
|
- ./db:/var/lib/mysql
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=examplerootpassword
|
|
- MYSQL_DATABASE=example
|
|
- MYSQL_USER=example
|
|
- MYSQL_PASSWORD=examplepassword
|
|
restart: always
|
|
networks:
|
|
- example-db-network
|
|
|
|
example-db-backup:
|
|
container_name: example-db-backup
|
|
image: tiredofit/db-backup
|
|
links:
|
|
- example-db
|
|
volumes:
|
|
- ./backups:/backup
|
|
#- ./post-script.sh:/assets/custom-scripts/post-script.sh
|
|
environment:
|
|
# - DEBUG_MODE=TRUE
|
|
- DB_TYPE=mariadb
|
|
- DB_HOST=example-db-host
|
|
- DB_NAME=example
|
|
- DB_USER=example
|
|
- DB_PASS=examplepassword
|
|
- DB_DUMP_FREQ=1 # backup every minute
|
|
# - DB_DUMP_BEGIN=0000 # backup starts immediately
|
|
- DB_CLEANUP_TIME=5 # clean backups they are older than 5 minute
|
|
- CHECKSUM=SHA1
|
|
- COMPRESSION=GZ
|
|
- SPLIT_DB=FALSE
|
|
- CONTAINER_ENABLE_MONITORING=FALSE
|
|
restart: always
|
|
networks:
|
|
- example-db-network
|
|
|
|
|