Skip to content

Commit 554df81

Browse files
authored
Merge pull request #112 from jkaninda/multi-backup
docs: add mutli database backup example
2 parents c5cca82 + ca56338 commit 554df81

File tree

2 files changed

+54
-4
lines changed

2 files changed

+54
-4
lines changed

docs/how-tos/encrypt-backup.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ nav_order: 8
66
---
77
# Encrypt backup
88

9-
The image supports encrypting backups using one of two available methods: GPG with passphrase or GPG with a public key
9+
The image supports encrypting backups using one of two available methods: GPG with passphrase or GPG with a public key.
1010

11-
## Using GPG passphrase
1211

1312
The image supports encrypting backups using GPG out of the box. In case a `GPG_PASSPHRASE` or `GPG_PUBLIC_KEY` environment variable is set, the backup archive will be encrypted using the given key and saved as a sql.gpg file instead or sql.gz.gpg.
1413

@@ -20,7 +19,7 @@ To restore an encrypted backup, you need to provide the same GPG passphrase used
2019

2120
{: .note }
2221
The backup encrypted using `GPG passphrase` method can be restored automatically, no need to decrypt it before restoration.
23-
22+
Suppose you used a GPG public key during the backup process. In that case, you need to decrypt your backup before restoration because decryption using a `GPG private` key is not fully supported.
2423

2524
To decrypt manually, you need to install `gnupg`
2625

@@ -34,7 +33,7 @@ Using your private key
3433
```shell
3534
gpg --output database_20240730_044201.sql.gz --decrypt database_20240730_044201.sql.gz.gpg
3635
```
37-
### Backup
36+
## Using GPG passphrase
3837

3938
```yml
4039
services:
@@ -61,4 +60,32 @@ services:
6160
- web
6261
networks:
6362
web:
63+
```
64+
## Using GPG Public Key
65+
66+
```yml
67+
services:
68+
mysql-bkup:
69+
# In production, it is advised to lock your image tag to a proper
70+
# release version instead of using `latest`.
71+
# Check https://github.com/jkaninda/mysql-bkup/releases
72+
# for a list of available releases.
73+
image: jkaninda/mysql-bkup
74+
container_name: mysql-bkup
75+
command: backup -d database
76+
volumes:
77+
- ./backup:/backup
78+
environment:
79+
- DB_PORT=3306
80+
- DB_HOST=mysql
81+
- DB_NAME=database
82+
- DB_USERNAME=username
83+
- DB_PASSWORD=password
84+
## Required to encrypt backup
85+
- GPG_PUBLIC_KEY=/config/public_key.asc
86+
# mysql-bkup container must be connected to the same network with your database
87+
networks:
88+
- web
89+
networks:
90+
web:
6491
```

docs/how-tos/mutli-backup.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,27 @@ databases:
3737
user: joplin
3838
password: password
3939
path: /s3-path/joplin #For SSH or FTP you need to define the full path (/home/toto/backup/)
40+
```
41+
## Docker compose file
42+
43+
```yaml
44+
services:
45+
mysql-bkup:
46+
# In production, it is advised to lock your image tag to a proper
47+
# release version instead of using `latest`.
48+
# Check https://github.com/jkaninda/mysql-bkup/releases
49+
# for a list of available releases.
50+
image: jkaninda/mysql-bkup
51+
container_name: mysql-bkup
52+
command: backup
53+
volumes:
54+
- ./backup:/backup
55+
environment:
56+
## Multi backup config file
57+
- BACKUP_CONFIG_FILE=/backup/config.yaml
58+
# mysql-bkup container must be connected to the same network with your database
59+
networks:
60+
- web
61+
networks:
62+
web:
4063
```

0 commit comments

Comments
 (0)