mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 13:23:12 +01:00
Version 4.0.x examples
This commit is contained in:
67
examples/compose.yml
Normal file
67
examples/compose.yml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
services:
|
||||||
|
example-db:
|
||||||
|
hostname: example-db-host
|
||||||
|
container_name: example-db
|
||||||
|
image: tiredofit/mariadb:10.11
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
volumes:
|
||||||
|
- ./db:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- ROOT_PASS=examplerootpassword
|
||||||
|
- DB_NAME=example
|
||||||
|
- DB_USER=example
|
||||||
|
- DB_PASS=examplepassword
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- example-db-network
|
||||||
|
|
||||||
|
example-db-backup:
|
||||||
|
container_name: example-db-backup
|
||||||
|
image: tiredofit/db-backup
|
||||||
|
volumes:
|
||||||
|
- ./backups:/backup
|
||||||
|
#- ./post-script.sh:/assets/custom-scripts/post-script.sh
|
||||||
|
environment:
|
||||||
|
- TIMEZONE=America/Vancouver
|
||||||
|
- CONTAINER_NAME=example-db-backup
|
||||||
|
- CONTAINER_ENABLE_MONITORING=FALSE
|
||||||
|
# - DEBUG_MODE=TRUE
|
||||||
|
|
||||||
|
- BACKUP_JOB_CONCURRENCY=1 # Only run one job at a time
|
||||||
|
- DEFAULT_CHECKSUM=NONE # Don't create checksums
|
||||||
|
- DEFAULT_COMPRESSION=ZSTD # Compress all with ZSTD
|
||||||
|
- DEFAULT_DUMP_INTERVAL=1440 # Backup every 1440 minutes
|
||||||
|
- DEFAULT_DUMP_BEGIN=0000 # Start backing up at midnight
|
||||||
|
- DEFAULT_CLEANUP_TIME=8640 # Cleanup backups after a week
|
||||||
|
|
||||||
|
- DB01_TYPE=mariadb
|
||||||
|
- DB01_HOST=example-db-host
|
||||||
|
- DB01_NAME=example
|
||||||
|
- DB01_USER=example
|
||||||
|
- DB01_PASS=examplepassword
|
||||||
|
- DB01_DUMP_INTERVAL=30 # (override) Backup every 30 minutes
|
||||||
|
- DB01_DUMP_BEGIN=+1 # (override) Backup starts immediately
|
||||||
|
- DB01_CLEANUP_TIME=180 # (override) Cleanup backups they are older than 180 minutes
|
||||||
|
- DB01_CHECKSUM=SHA1 # (override) Create a SHA1 checksum
|
||||||
|
- DB01_COMPRESSION=GZ # (override) Compress with GZIP
|
||||||
|
|
||||||
|
#- DB02_TYPE=postgres
|
||||||
|
#- DB02_HOST=example-postgres-host
|
||||||
|
#- DB02_NAME=example
|
||||||
|
#- DB02_USER=example
|
||||||
|
#- DB02_PASS=examplepassword
|
||||||
|
#- DB02_DUMP_INTERVAL=60 # (override) Backup every 60 minutes
|
||||||
|
#- DB02_DUMP_BEGIN=+10 # (override) Backup starts in ten minutes
|
||||||
|
#- DB02_CLEANUP_TIME=240 # (override) Cleanup backups they are older than 240 minutes
|
||||||
|
#- DB02_CHECKSUM=MD5 # (override) Create a SHA1 checksum
|
||||||
|
#- DB02_COMPRESSION=BZ # (override) Compress with BZIP
|
||||||
|
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- example-db-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
example-db-network:
|
||||||
|
name: example-db-network
|
||||||
|
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Example for Microsoft SQL Server
|
# Example for Microsoft SQL Server
|
||||||
# upload with blobxfer to azure storage
|
# upload with blobxfer to azure storage
|
||||||
#
|
#
|
||||||
|
|
||||||
version: '2'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
example-mssql-blobxfer-net:
|
|
||||||
name: example-mssql-blobxfer-net
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
example-mssql-s3-db:
|
example-mssql-s3-db:
|
||||||
@@ -32,7 +26,7 @@ services:
|
|||||||
# execute in terminal --> docker build -t tiredofit/db-backup-mssql-blobxfer .
|
# execute in terminal --> docker build -t tiredofit/db-backup-mssql-blobxfer .
|
||||||
# replace --> image: tiredofit/db-backup-mssql
|
# replace --> image: tiredofit/db-backup-mssql
|
||||||
# image: tiredofit/db-backup
|
# image: tiredofit/db-backup
|
||||||
image: tiredofit/db-backup-mssql-blobxfer
|
image: tiredofit/db-backup
|
||||||
links:
|
links:
|
||||||
- example-mssql-s3-db
|
- example-mssql-s3-db
|
||||||
volumes:
|
volumes:
|
||||||
@@ -40,30 +34,35 @@ services:
|
|||||||
- ./tmp/backups:/tmp/backups # shared tmp backup directory
|
- ./tmp/backups:/tmp/backups # shared tmp backup directory
|
||||||
#- ./post-script.sh:/assets/custom-scripts/post-script.sh
|
#- ./post-script.sh:/assets/custom-scripts/post-script.sh
|
||||||
environment:
|
environment:
|
||||||
# - DEBUG_MODE=TRUE
|
- TIMEZONE=America/Vancouver
|
||||||
- DB_TYPE=mssql
|
|
||||||
- DB_HOST=example-db-host
|
|
||||||
# - DB_PORT=1488
|
|
||||||
# - DB_NAME=ALL # [ALL] not working on sql server.
|
|
||||||
# create database with name `test1` manually first
|
|
||||||
- DB_NAME=test1 # Create this database
|
|
||||||
- DB_USER=sa
|
|
||||||
- DB_PASS=5hQa0utRFBpIY3yhoIyE
|
|
||||||
- DB_DUMP_FREQ=1 # backup every 5 minute
|
|
||||||
# - DB_DUMP_BEGIN=0000 # backup starts immediately
|
|
||||||
- DB_CLEANUP_TIME=3 # clean backups they are older than 60 minutes
|
|
||||||
- ENABLE_CHECKSUM=TRUE
|
|
||||||
- CHECKSUM=SHA1
|
|
||||||
- COMPRESSION=GZ
|
|
||||||
- SPLIT_DB=FALSE
|
|
||||||
- CONTAINER_ENABLE_MONITORING=FALSE
|
- CONTAINER_ENABLE_MONITORING=FALSE
|
||||||
|
- CONTAINER_NAME=example-mssql-blobxfer-db-backup
|
||||||
|
# - DEBUG_MODE=TRUE
|
||||||
|
- DB01_TYPE=mssql
|
||||||
|
- DB01_HOST=example-db-host
|
||||||
|
# - DB01_PORT=1488
|
||||||
|
# create database with name `test1` manually first
|
||||||
|
- DB01_NAME=test1 # Create this database
|
||||||
|
- DB01_USER=sa
|
||||||
|
- DB01_PASS=5hQa0utRFBpIY3yhoIyE
|
||||||
|
- DB01_DUMP_INTERVAL=5 # backup every 5 minute
|
||||||
|
# - DB01_DUMP_BEGIN=0000 # backup starts at midnight vs not set immediately
|
||||||
|
- DB01_CLEANUP_TIME=60 # clean backups they are older than 60 minutes
|
||||||
|
- DB01_CHECKSUM=SHA1 # Set Checksum to be SHA1
|
||||||
|
- DB01_COMPRESSION=GZ # Set compression to use GZIP
|
||||||
|
|
||||||
|
|
||||||
# === S3 Blobxfer ===
|
# === S3 Blobxfer ===
|
||||||
- BACKUP_LOCATION=blobxfer
|
- DB01_BACKUP_LOCATION=blobxfer
|
||||||
# Add here azure storage account
|
# Add here azure storage account
|
||||||
- BLOBXFER_STORAGE_ACCOUNT={TODO Add Storage Name}
|
- DB01_BLOBXFER_STORAGE_ACCOUNT={TODO Add Storage Name}
|
||||||
# Add here azure storage account key
|
# Add here azure storage account key
|
||||||
- BLOBXFER_STORAGE_ACCOUNT_KEY={TODO Add Key}
|
- SB01_BLOBXFER_STORAGE_ACCOUNT_KEY={TODO Add Key}
|
||||||
- BLOBXFER_REMOTE_PATH=docker-db-backup
|
- DB01_BLOBXFER_REMOTE_PATH=docker-db-backup
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
example-mssql-blobxfer-net:
|
example-mssql-blobxfer-net:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
example-mssql-blobxfer-net:
|
||||||
|
name: example-mssql-blobxfer-net
|
||||||
@@ -1,12 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Example for Microsoft SQL Server
|
# Example for Microsoft SQL Server
|
||||||
#
|
#
|
||||||
|
|
||||||
version: '2'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
example-mssql-net:
|
|
||||||
name: example-mssql-net
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
example-mssql-db:
|
example-mssql-db:
|
||||||
@@ -31,7 +25,7 @@ services:
|
|||||||
# execute in terminal --> docker build -t tiredofit/db-backup-mssql .
|
# execute in terminal --> docker build -t tiredofit/db-backup-mssql .
|
||||||
# replace --> image: tiredofit/db-backup-mssql
|
# replace --> image: tiredofit/db-backup-mssql
|
||||||
# image: tiredofit/db-backup
|
# image: tiredofit/db-backup
|
||||||
image: tiredofit/db-backup-mssql
|
image: tiredofit/db-backup
|
||||||
links:
|
links:
|
||||||
- example-mssql-db
|
- example-mssql-db
|
||||||
volumes:
|
volumes:
|
||||||
@@ -39,23 +33,28 @@ services:
|
|||||||
- ./tmp/backups:/tmp/backups # shared tmp backup directory
|
- ./tmp/backups:/tmp/backups # shared tmp backup directory
|
||||||
#- ./post-script.sh:/assets/custom-scripts/post-script.sh
|
#- ./post-script.sh:/assets/custom-scripts/post-script.sh
|
||||||
environment:
|
environment:
|
||||||
|
- TIMEZONE=America/Vancouver
|
||||||
|
- CONTAINER_ENABLE_MONITORING=FALSE
|
||||||
|
- CONTAINER_NAME=example-mssql-blobxfer-db-backup
|
||||||
|
|
||||||
# - DEBUG_MODE=TRUE
|
# - DEBUG_MODE=TRUE
|
||||||
- DB_TYPE=mssql
|
- DB01_TYPE=mssql
|
||||||
- DB_HOST=example-db-host
|
- DB01_HOST=example-db-host
|
||||||
# - DB_PORT=1488
|
# - DB_PORT=1488
|
||||||
# - DB_NAME=ALL # [ALL] not working on sql server.
|
# - DB_NAME=ALL # [ALL] not working on sql server.
|
||||||
# create database with name `test1` manually first
|
# create database with name `test1` manually first
|
||||||
- DB_NAME=test1
|
- DB01_NAME=test1
|
||||||
- DB_USER=sa
|
- DB01_USER=sa
|
||||||
- DB_PASS=5hQa0utRFBpIY3yhoIyE
|
- DB01_PASS=5hQa0utRFBpIY3yhoIyE
|
||||||
- DB_DUMP_FREQ=1 # backup every minute
|
- DB01_DUMP_INTERVAL=1 # backup every minute
|
||||||
# - DB_DUMP_BEGIN=0000 # backup starts immediately
|
# - DB01_DUMP_BEGIN=0000 # backup starts at midnight vs unset immediately
|
||||||
- DB_CLEANUP_TIME=5 # clean backups they are older than 5 minute
|
- DB01_CLEANUP_TIME=5 # clean backups they are older than 5 minute
|
||||||
- ENABLE_CHECKSUM=FALSE
|
- DB01_CHECKSUM=NONE
|
||||||
- CHECKSUM=SHA1
|
- DB01_COMPRESSION=GZ
|
||||||
- COMPRESSION=GZ
|
|
||||||
- SPLIT_DB=FALSE
|
|
||||||
- CONTAINER_ENABLE_MONITORING=FALSE
|
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
example-mssql-net:
|
example-mssql-net:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
example-mssql-net:
|
||||||
|
name: example-mssql-net
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user