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: - TIMEZONE=America/Vancouver - CONTAINER_ENABLE_MONITORING=FALSE # - 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 restart: always networks: - example-db-network