generated from ztimson/template
Added replica init
All checks were successful
Build and publish / Build Container (push) Successful in 1m47s
All checks were successful
Build and publish / Build Container (push) Successful in 1m47s
This commit is contained in:
29
README.md
29
README.md
@@ -41,25 +41,28 @@ MongoDB + Backups & Retention
|
||||
|
||||
## About
|
||||
|
||||
Custom MongoDB Docker image extending `mongo:latest` with automated backup functionality.
|
||||
Custom MongoDB Docker image extending `mongo:latest` with automated backups, retention management, and replica set configuration.
|
||||
|
||||
Installs cron to run scheduled mongodump operations with compression and retention management, while preserving all native MongoDB server functionality.
|
||||
Includes cron-based scheduled `mongodump` operations with compression, automatic stale lock recovery on unclean shutdowns, and zero-config replica set initialization — while preserving all native MongoDB functionality.
|
||||
|
||||
Backups can be manually triggered with: `docker --exec -t mongodb backup`
|
||||
**Manually trigger a backup:**
|
||||
docker exec -t mongodb backup
|
||||
|
||||
To restore a backup, uncompress it and use the official `mongorestore`
|
||||
**Restore a backup:**
|
||||
Decompress the archive and use the official `mongorestore` tool.
|
||||
|
||||
### Environment Variables
|
||||
|
||||
| Variable | Description | Default | Example |
|
||||
|------------------------------|--------------------------------------------------|--------------------------|---------------|
|
||||
| `BACKUP_CRON` | Cron schedule expression | | `0 */6 * * *` |
|
||||
| `BACKUP_DIR` | Directory to store backups | `/data/backups` | `/backups` |
|
||||
| `BACKUP_DB` | Database to backup | `$MONGO_INITDB_DATABASE` | `admin` |
|
||||
| `BACKUP_RETENTION` | Number of backups to keep, defaults to unlimited | | `7` |
|
||||
| `MONGO_INITDB_DATABASE` | Default database name | | `momentum` |
|
||||
| `MONGO_INITDB_ROOT_USERNAME` | Root username for mongodump auth | | `root` |
|
||||
| `MONGO_INITDB_ROOT_PASSWORD` | Root password for mongodump auth | | `secret` |
|
||||
| Variable | Description | Default | Example |
|
||||
|------------------------------|----------------------------------------------------------------------|--------------------------|-----------------------|
|
||||
| `BACKUP_CRON` | Cron schedule expression | | `0 */6 * * *` |
|
||||
| `BACKUP_DIR` | Directory to store backups | `/data/backups` | `/backups` |
|
||||
| `BACKUP_DB` | Database to backup | `$MONGO_INITDB_DATABASE` | `admin` |
|
||||
| `BACKUP_RETENTION` | Number of backups to keep, defaults to unlimited | | `7` |
|
||||
| `MONGO_INITDB_DATABASE` | Default database name | | `momentum` |
|
||||
| `MONGO_INITDB_ROOT_USERNAME` | Root username for mongodump auth | | `root` |
|
||||
| `MONGO_INITDB_ROOT_PASSWORD` | Root password for mongodump auth | | `secret` |
|
||||
| `REPLICA` | Comma-separated list of replica hostnames to init/join a replica set | | `db1:27017,db2:27017` |
|
||||
|
||||
### Built With
|
||||
|
||||
|
||||
Reference in New Issue
Block a user