compose: add AutoKuma and monitor labels
AutoKuma reads kuma.* labels from containers on this Docker host and creates the matching Uptime Kuma monitors (web, public site, tracker). Needs KUMA_USERNAME / KUMA_PASSWORD in .env. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+30
-1
@@ -21,6 +21,15 @@ services:
|
||||
SITE_ADDRESS: ${SITE_ADDRESS:-:80}
|
||||
volumes: [caddy_data:/data, caddy_config:/config]
|
||||
depends_on: [tracker]
|
||||
labels:
|
||||
# AutoKuma: kuma.<id>.<type>.<setting>
|
||||
kuma.rain.group.name: "Rain website"
|
||||
kuma.web.http.name: "Caddy (internal)"
|
||||
kuma.web.http.url: "http://web:80"
|
||||
kuma.web.http.parent_name: "rain"
|
||||
kuma.site.http.name: "Public site"
|
||||
kuma.site.http.url: "https://${SITE_HOST}"
|
||||
kuma.site.http.parent_name: "rain"
|
||||
|
||||
tracker:
|
||||
build: { context: ., dockerfile: tracker/Dockerfile }
|
||||
@@ -31,6 +40,11 @@ services:
|
||||
SITE_HOST: ${SITE_HOST}
|
||||
volumes: ["./geoip:/data:ro"]
|
||||
depends_on: []
|
||||
labels:
|
||||
kuma.tracker.port.name: "Tracker"
|
||||
kuma.tracker.port.hostname: "tracker"
|
||||
kuma.tracker.port.port: "8000"
|
||||
kuma.tracker.port.parent_name: "rain"
|
||||
|
||||
linkcheck:
|
||||
build: { context: ., dockerfile: tracker/Dockerfile }
|
||||
@@ -47,4 +61,19 @@ services:
|
||||
ports: ["${KUMA_BIND:-127.0.0.1:3001}:3001"]
|
||||
volumes: [kuma_data:/app/data]
|
||||
|
||||
volumes: { caddy_data: {}, caddy_config: {}, kuma_data: {} }
|
||||
# AutoKuma: creates/updates/removes Kuma monitors from the kuma.* labels above.
|
||||
# Needs the Kuma admin login in .env (KUMA_USERNAME / KUMA_PASSWORD).
|
||||
autokuma:
|
||||
image: ghcr.io/bigboot/autokuma:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
AUTOKUMA__KUMA__URL: http://kuma:3001
|
||||
AUTOKUMA__KUMA__USERNAME: ${KUMA_USERNAME:-}
|
||||
AUTOKUMA__KUMA__PASSWORD: ${KUMA_PASSWORD:-}
|
||||
AUTOKUMA__TAG_NAME: AutoKuma
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- autokuma_data:/data
|
||||
depends_on: [kuma]
|
||||
|
||||
volumes: { caddy_data: {}, caddy_config: {}, kuma_data: {}, autokuma_data: {} }
|
||||
|
||||
Reference in New Issue
Block a user