203 lines
3.5 KiB
Markdown
203 lines
3.5 KiB
Markdown
<p align="center">
|
|
<img src="images/dockervault_logo.png" width="600">
|
|
</p>
|
|
|
|
# DockerVault
|
|
|
|
> Intelligent Docker backup discovery for real systems
|
|
|
|
DockerVault scans your Docker environments and figures out **what actually matters to back up** — automatically.
|
|
|
|
No guesswork. No forgotten volumes. No broken restores.
|
|
|
|
---
|
|
|
|
## 📚 Contents
|
|
|
|
* 🚀 What is DockerVault?
|
|
* ⚡ Quick Start
|
|
* 🧠 How it Works
|
|
* 🗂 Classification Model
|
|
* 💾 Borg Integration
|
|
* 🤖 Automation Mode
|
|
* 🔍 Example
|
|
* 🛠 Tech Stack
|
|
* 🔢 Exit Codes
|
|
* 🔥 Future Ideas
|
|
* ❤️ Credits
|
|
* 📜 License
|
|
|
|
---
|
|
|
|
## 🚀 What is DockerVault?
|
|
|
|
DockerVault is a CLI tool that:
|
|
|
|
* scans Docker Compose environments
|
|
* detects bind mounts and named volumes
|
|
* identifies **critical data paths**
|
|
* warns about missing or broken setups
|
|
* generates **ready-to-use Borg backup commands**
|
|
|
|
It focuses on **real-world setups**, not theoretical configs.
|
|
|
|
---
|
|
|
|
## ⚡ Quick Start
|
|
|
|
```bash
|
|
git clone https://git.lanx.dk/ed/dockervault.git
|
|
cd dockervault
|
|
python -m venv .venv
|
|
source .venv/bin/activate
|
|
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
Run a scan:
|
|
|
|
```bash
|
|
python -m dockervault.cli /path/to/docker
|
|
```
|
|
|
|
Generate a Borg backup plan:
|
|
|
|
```bash
|
|
python -m dockervault.cli /path/to/docker --repo /backup --dry-run
|
|
```
|
|
|
|
---
|
|
|
|
## 🧠 How it Works
|
|
|
|
DockerVault:
|
|
|
|
1. Searches for Docker Compose files
|
|
2. Parses all services and mounts
|
|
3. Applies classification rules
|
|
4. Builds a structured backup plan
|
|
|
|
It focuses on **what actually matters to restore a system**.
|
|
|
|
---
|
|
|
|
## 🗂 Classification Model
|
|
|
|
DockerVault divides data into:
|
|
|
|
### 🔴 Critical
|
|
|
|
Must be backed up:
|
|
|
|
* databases (`/var/lib/mysql`, etc.)
|
|
* application data (`/data`, etc.)
|
|
|
|
### 🟡 Review
|
|
|
|
Optional:
|
|
|
|
* logs
|
|
* caches
|
|
* temporary files
|
|
|
|
### ⚪ Skip
|
|
|
|
Safe to ignore:
|
|
|
|
* ephemeral runtime data
|
|
|
|
---
|
|
|
|
## 💾 Borg Integration
|
|
|
|
DockerVault generates ready-to-use Borg commands:
|
|
|
|
```bash
|
|
borg create --stats --progress \
|
|
/backup::hostname-YYYY-MM-DD_HH-MM \
|
|
/path1 \
|
|
/path2
|
|
```
|
|
|
|
No guessing. No missing volumes.
|
|
|
|
---
|
|
|
|
## 🤖 Automation Mode
|
|
|
|
DockerVault supports automation-friendly usage:
|
|
|
|
```bash
|
|
python -m dockervault.cli /path --repo /backup --automation --quiet
|
|
```
|
|
|
|
* exit code `0` → OK
|
|
* exit code `1` → missing critical paths
|
|
|
|
Perfect for cron jobs and monitoring.
|
|
|
|
---
|
|
|
|
## 🔍 Example
|
|
|
|
```text
|
|
DockerVault Backup Plan
|
|
=======================
|
|
Scan root: /srv/docker
|
|
|
|
INCLUDE PATHS:
|
|
- /srv/docker/db [critical] service=db target=/var/lib/mysql
|
|
- /srv/docker/app/data [critical] service=app target=/data
|
|
|
|
REVIEW PATHS:
|
|
- /srv/docker/logs [optional]
|
|
|
|
WARNING: Missing critical paths detected
|
|
- /srv/docker/app/data (service=app)
|
|
```
|
|
|
|
---
|
|
|
|
## 🛠 Tech Stack
|
|
|
|
* Python 3.10+
|
|
* Docker Compose parsing
|
|
* Custom classification engine
|
|
* Borg backup integration
|
|
|
|
---
|
|
|
|
## 🔢 Exit Codes
|
|
|
|
| Code | Meaning |
|
|
| ---- | ---------------------------------------- |
|
|
| 0 | Success |
|
|
| 1 | Missing critical paths (automation mode) |
|
|
| 2 | Error / invalid input |
|
|
|
|
---
|
|
|
|
## 🔥 Future Ideas
|
|
|
|
* JSON output (`--json`)
|
|
* Web UI
|
|
* Email / ntfy notifications
|
|
* Restore validation
|
|
* Smarter service detection
|
|
* Backup manifests
|
|
|
|
---
|
|
|
|
## ❤️ Credits
|
|
|
|
Built with ❤️ for Lanx by [NodeFox 🦊](https://nodefox.lanx.dk)
|
|
|
|
Maintained by [Eddie Nielsen](https://lanx.dk)
|
|
|
|
Feel free to contribute, suggest improvements or fork the project.
|
|
|
|
---
|
|
|
|
## 📜 License
|
|
|
|
This project is licensed under the GNU GPL v3.
|