The purpose of this is to schedule and run mysqldump against the specified server, and save the results to a file.
Configuration happens through environment variables:
CRON_MINUTE,CRON_HOUR,CRON_DOM,CRON_MONTHandCRON_DOWcontrol the cronjob.TZsets the time zone (e.g. Europe/Rome).DB_SERVERis the MySQL/MariaDB server host.DB_USERis the MySQL/MariaDB username.DB_PASSis the MySQL/MariaDB password.DB_NAMEis the MySQL/MariaDB database name.OUT_PATHis the full output path for the dump. Usually on a volume/mount. This path must be writable by UID 1001, otherwise you'll need to edit the Dockerfile.COMPRESSif set to a literal "true", enables gzip compression of the dump file.PRE_COMMANDScontains commands to be executed before starting a backup.POST_COMMANDS_SUCCESScontains commands to be executed after a successful backup.POST_COMMANDS_FAILUREcontains commands to be executed after a failed backup.POST_COMMANDS_EXITcontains commands to be executed after the backup process, regardless of the result.
DB_SERVER, DB_USER, DB_PASS, DB_NAME, OUT_PATH can be replaced with DB_SERVER_FILE, DB_USER_FILE, DB_PASS_FILE, DB_NAME_FILE, OUT_PATH_FILE: the contents of such files will be used as the value. This allows you to use Docker secrets.