Initial upload
This commit is contained in:
44
recipes/services/portainer-watchtower/install.sh
Normal file
44
recipes/services/portainer-watchtower/install.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ensure_root
|
||||
detect_pkg_manager
|
||||
pkg_install curl
|
||||
|
||||
BASE="/srv/docker/system/portainer-watchtower"
|
||||
$SUDO mkdir -p "$BASE"
|
||||
cd "$BASE"
|
||||
|
||||
echo "Starte Installation von Portainer + Watchtower..."
|
||||
|
||||
$SUDO tee docker-compose.yml >/dev/null <<'EOF'
|
||||
services:
|
||||
portainer:
|
||||
image: portainer/portainer-ce:latest
|
||||
container_name: portainer
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9443:9443"
|
||||
- "9000:9000"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./portainer-data:/data
|
||||
|
||||
watchtower:
|
||||
image: containrrr/watchtower:latest
|
||||
container_name: watchtower
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
command:
|
||||
- --schedule=0 0 3 * * *
|
||||
- --cleanup
|
||||
- --rolling-restart
|
||||
- --update-delay=72h
|
||||
EOF
|
||||
|
||||
$SUDO docker compose up -d
|
||||
|
||||
log "Portainer + Watchtower installiert."
|
||||
log "Portainer UI: https://<server-ip>:9443 (oder http://<server-ip>:9000)"
|
||||
log "Watchtower aktualisiert Container täglich um 03:00 Uhr mit 72h Verzögerung."
|
||||
Reference in New Issue
Block a user