We moved an internal tool to docker (docker-compose), this includes the required MySQL Database.
I looked for a easy solution todo a backup through mysqldump and found something great 🙂
This is the relevant docker-compose part:
|
|
If this docker-compose is running, the mysql container get the following name ‘ourtool_mysql_1’
The network gets the compose name added:
|
|
We want our backups in the host folder /mnt/Backups/ourtool/sql (This is a nfs mounted folder).
Now we just put this information together:
|
|
That’s it, it runs, after that the temporary container gets destroyed and you can find the data on the host itself (’/mnt/Backups/ourtool/sql’ in my case)
We now just run this as a cronjob
|
|