Production-ready MongoDB backup with AES-256-GCM encryption, compression.
778
A secure, production-ready MongoDB backup solution with encryption, compression, and air-gapped deployment capabilities.
š MEDIUM : https://medium.com/@arconixforgeā š» Git ā https://github.com/ArconixForgeā š³ Docker ā https://hub.docker.com/u/arconixforgeā š¦ Artifact ā https://artifacthub.io/packages/search?user=ArconixForgeā š³ X ā https://x.com/ArconixForgeā
Pull the Docker image:
docker pull arconixforge/mongodb-secure-backup:latest
Run a backup (basic):
docker run -v /path/to/backups:/backups \
-e MONGO_HOST=your-mongodb-host \
-e MONGO_PORT=27017 \
-e MONGO_USERNAME=your-username \
-e MONGO_PASSWORD=your-password \
arconixforge/mongodb-secure-backup:latest auto-backup
Run a backup with encryption:
docker run -v /path/to/backups:/backups \
-e MONGO_HOST=your-mongodb-host \
-e MONGO_USERNAME=your-username \
-e MONGO_PASSWORD=your-password \
-e ENCRYPTION_ENABLED=true \
-e ENCRYPTION_PASSWORD=your-secure-encryption-key \
arconixforge/mongodb-secure-backup:latest auto-backup
| Variable | Description | Default |
|---|---|---|
MONGO_HOST | MongoDB host | 127.0.0.1 |
MONGO_PORT | MongoDB port | 27018 |
MONGO_USERNAME | MongoDB username | - |
MONGO_PASSWORD | MongoDB password | - |
MONGO_AUTH_DB | Authentication database | admin |
USE_SSL | Enable SSL connection | false |
SSL_CA_FILE | Path to SSL CA file | - |
CONNECTION_TIMEOUT_MS | Connection timeout in ms | 30000 |
BACKUP_OUTPUT_DIR | Output directory for backups | /backups |
PRETTY_JSON | Format JSON output | true |
MAX_CONCURRENT_EXPORTS | Number of parallel exports | 3 |
RETRY_ATTEMPTS | Number of retry attempts | 3 |
RETRY_DELAY_SECONDS | Delay between retries | 2 |
CHUNK_SIZE | Batch size for large collections | 1000 |
EXCLUDE_DBS | Comma-separated list of DBs to exclude | - |
EXCLUDE_COLLECTIONS | Collection exclusion patterns | - |
ENCRYPTION_ENABLED | Enable encryption for backups | false |
ENCRYPTION_PASSWORD | Password for encryption | - |
COMPRESSION_METHOD | Compression (none, zlib, gzip, lzma) | zlib |
COMPRESSION_LEVEL | Compression level (1-9) | 6 |
The tool can also use a configuration file. A default file is generated on first run, or you can mount your own:
docker run -v /path/to/config.ini:/app/mongodb_backup.ini \
-v /path/to/backups:/backups \
arconixforge/mongodb-secure-backup:latest auto-backup
docker run arconixforge/mongodb-secure-backup:latest --list-dbs
docker run -v /path/to/backups:/backups \
-e MONGO_HOST=your-mongodb-host \
arconixforge/mongodb-secure-backup:latest --export --databases database1,database2
docker run -v /path/to/backups:/backups \
-e MONGO_HOST=your-mongodb-host \
-e ENCRYPTION_ENABLED=true \
-e ENCRYPTION_PASSWORD=your-secure-key \
arconixforge/mongodb-secure-backup:latest --export --create-archive
docker run -e MONGO_HOST=your-mongodb-host \
arconixforge/mongodb-secure-backup:latest --test-connection
This solution comprises:
docker run --rm arconixforge/mongodb-secure-backup:latest --test-connection
Please ensure your code adheres to the existing style and includes appropriate tests.
## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## Acknowledgements
- MongoDB Team for their excellent database and tools
- Python Cryptography library for secure encryption
- Docker for containerization
- All open-source contributors who make projects like this possible
Content type
Image
Digest
sha256:c08d7c438ā¦
Size
123.5 MB
Last updated
over 1 year ago
docker pull arconixforge/mongodb-secure-backup:v1.1