-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b071f7
commit ccad0c8
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
![Dump & dumper](./assets/dump-and-dumper.png) | ||
|
||
<center> | ||
<h1>Dump & dumper</h1> | ||
</center | ||
Dump & dumper is a simple cli tool written in go to ease the process of containerized database backup and upload result into a s3 bucket | ||
> Dump & dumper 1.0.0 currently support only _postgress_ database | ||
|
||
# Usage | ||
|
||
|
||
Add labels to the containers you want to dump | ||
|
||
The above labels are currently available | ||
| label | description | | ||
| ----------------- | -------------------------------------------------- | | ||
| go-dumper.enabled | Use to determined if the container should be dump | | ||
| go-dumper.user | The database user to use during the dump process | | ||
| go-dumper.type | The database type (for now only "pg" is available) | | ||
|
||
> docker-compose example | ||
```yml | ||
version: '3.0' | ||
services: | ||
pg_dump_1: | ||
image: postgres:latest | ||
environment: | ||
POSTGRES_PASSWORD: test | ||
POSTGRES_DB: test | ||
labels: | ||
- 'go-dumper.enabled=true' | ||
- 'go-dumper.user=postgres' | ||
- 'go-dumper.type=pg' | ||
``` | ||
|
||
Then start or restart your docker containers | ||
|
||
|
||
After that you can run the dump command using desired s3 options | ||
|
||
The above flags are available | ||
|
||
| flag | description | | ||
| ----------------- | ---------------------------------- | | ||
| --s3-endpoint | Set the endpoint of your s3 bucket | | ||
| --s3-bucket | Set the targeted bucket name | | ||
| --s3-secretKeyId | Set the secret key id | | ||
| --s3-secretKey | Set the secret key | | ||
|
||
```sh | ||
dump-dumper dump --s3-endpoint=S3_ENDPOINT --s3-bucket=BUCKET_NAME --s3-secretKeyId=SECRET_KEY_ID --s3-secretKey=SECRET_KEY --s3-region=REGION | ||
|
||
``` |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.