first commit
This commit is contained in:
128
README.md
Normal file
128
README.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# Docker Compose Auto-Updater
|
||||
|
||||
Dieses Script überprüft mehrere Docker-Compose-Stacks auf Image-Updates und aktualisiert diese automatisch.
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- 🔄 Stack-basiertes Update
|
||||
- 🧪 Dry-Run Modus
|
||||
- 📲 ntfy Benachrichtigungen
|
||||
- ⏭️ Exclude-Liste für Services
|
||||
|
||||
---
|
||||
|
||||
## 📂 Voraussetzungen
|
||||
|
||||
- Docker + Docker Compose (v2)
|
||||
- Bash
|
||||
- Optional: ntfy Server
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Konfiguration (`config.conf`)
|
||||
|
||||
```bash
|
||||
# Pfad zu deinen Compose-Files
|
||||
COMPOSE_DIR="/pfad/zu/deinen/stacks"
|
||||
# Dateimuster
|
||||
COMPOSE_PATTERN="docker-compose.yml"
|
||||
|
||||
# Exclude Container
|
||||
EXCLUDE_SERVICES=(
|
||||
"example_container_1"
|
||||
"example_container_2"
|
||||
)
|
||||
|
||||
# Exclude Stack
|
||||
EXCLUDE_STACKS=(
|
||||
"example_stack_1"
|
||||
"example_stack_2"
|
||||
)
|
||||
|
||||
# Verhalten bei gestoppten Containern
|
||||
UPDATE_STOPPED=true # Image aktualisieren
|
||||
START_STOPPED=false # danach NICHT starten
|
||||
|
||||
# Dry Run (true/false)
|
||||
DRY_RUN=false
|
||||
|
||||
# Logging
|
||||
LOG_FILE="/pfad/zum/log/update.log"
|
||||
LOG_LEVEL="INFO"
|
||||
|
||||
# ntfy
|
||||
NTFY_ENABLED=true
|
||||
NTFY_TITLE="Docker Update ($(hostname))"
|
||||
NTFY_TOKEN="DEIN_TOKEN"
|
||||
NTFY_URL="https://ntfy.example.com/topic"
|
||||
NTFY_TAGS="docker,update"
|
||||
NTFY_ONLY_ON_CHANGES=false
|
||||
# Versions Nr. der Container in der NTFY Nachricht anzeigen (true/false)
|
||||
SHOW_VERSIONS=true
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ▶️ Nutzung
|
||||
|
||||
```bash
|
||||
chmod +x script.sh
|
||||
./script.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🧠 Funktionsweise
|
||||
|
||||
1. Alle `docker-compose.yml` Dateien werden gefunden
|
||||
2. Alphabetisch sortiert
|
||||
3. Jeder Stack wird geprüft:
|
||||
- Image wird gepullt
|
||||
- Vergleich: Container Image-ID vs. aktuelles Image
|
||||
4. Wenn ein Service ein Update hat:
|
||||
- kompletter Stack wird neu deployed
|
||||
|
||||
---
|
||||
|
||||
## 🔔 ntfy Prioritäten
|
||||
|
||||
| Zustand | Priorität |
|
||||
|----------------------|----------|
|
||||
| ✔️ Keine Updates | 1 |
|
||||
| 🔄 Updates vorhanden | 3 |
|
||||
| ❌ Fehler | 5 |
|
||||
|
||||
---
|
||||
|
||||
## 📄 Beispiel Ausgabe
|
||||
|
||||
```
|
||||
→ Prüfe Stack: homepage
|
||||
├─ dockerproxy (image)
|
||||
└─ homepage (image)
|
||||
|
||||
→ Prüfe Stack: app
|
||||
├─ db (image)
|
||||
⬆️ UPDATE
|
||||
alt: sha256:abc
|
||||
neu: sha256:def
|
||||
└─ web (image)
|
||||
🔄 Stack wird neu deployt
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Hinweise
|
||||
|
||||
Wird in einem Stack ein Container aktualisiert, wird anschließend der gesamte Stack neu gestartet, sofern er mehr als einen Container enthält. Dadurch wird sichergestellt, dass alle Abhängigkeiten wieder gemäß der `docker-compose.yml` ausgeführt werden.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Dry Run
|
||||
|
||||
```bash
|
||||
DRY_RUN=true
|
||||
```
|
||||
|
||||
→ zeigt nur, was passieren würde
|
||||
Reference in New Issue
Block a user