https://github.com/felbinger/dbm
Docker Backup Manager
https://github.com/felbinger/dbm
backup docker
Last synced: about 2 months ago
JSON representation
Docker Backup Manager
- Host: GitHub
- URL: https://github.com/felbinger/dbm
- Owner: felbinger
- Created: 2021-01-30T22:02:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-03T21:59:50.000Z (about 3 years ago)
- Last Synced: 2025-04-10T00:55:14.740Z (about 1 year ago)
- Topics: backup, docker
- Language: Shell
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Backup Manager
The Docker Backup Manager (DBM) is a docker image to back up the database and ldap server inside your docker container.
## Packages
* mariadb-client (`mysql` and `mysqldump`)
* postgresql-client (`psql` and `pg_dump`)
* openldap-clients (`ldapsearch`)
## Usage
This repository contains a [`docker-compose.yml`](./docker-compose.yml), which can be used to test the image.
```shell
docker run --rm -it \
-v "/var/backups/:/data/" \
--env-file .dbm.env \
--network=dbm_default \
ghcr.io/felbinger/dbm
```
If you'd like to execute the backup using a cronjob, you need to to remove the parameter `-it` from the command.
```shell
# run database backup every three hours
0 */3 * * * /bin/bash /root/db_backup.sh >/dev/null 2>&1
```
## Environment Variables
| Variable Name | Description | Default Value |
|------------------------|--------------------------------------------------|---------------|
| LDAP_SCHEMA | LDAP schema to use (`ldap` / `ldaps`) | ldap |
| LDAP_HOST | Container name of the ldap container. | |
| LDAP_PORT | Port of the ldap server. | 389 |
| LDAP_BASE_DN | | |
| LDAP_BIND_DN | | |
| LDAP_BIND_PW | | |
| MARIADB_HOST | Container name of the mariadb container. | |
| MARIADB_PORT | Port of the mariadb server. | 3306 |
| MARIADB_USERNAME | Username of the backup user. | backup |
| MARIADB_PASSWORD | Password of the backup user. | |
| MARIADB_DATABASES | Databases that should be included in the backup. | |
| POSTGRES_HOST | Container name of the postgresql container. | |
| POSTGRES_PORT | Port of the postgres server. | 5432 |
| POSTGRES_USERNAME | Username of the backup user. | backup |
| POSTGRES_PASSWORD | Password of the backup user. | |
| POSTGRES_DATABASES | Databases that should be included in the backup. | |