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:
@@ -22,3 +22,7 @@ BACKUP_PORT=22
|
|||||||
# Optional Uptime Kuma push monitors (create them in the Kuma UI, paste the push URLs)
|
# Optional Uptime Kuma push monitors (create them in the Kuma UI, paste the push URLs)
|
||||||
KUMA_BACKUP_PUSH_URL=
|
KUMA_BACKUP_PUSH_URL=
|
||||||
KUMA_LINKS_PUSH_URL=
|
KUMA_LINKS_PUSH_URL=
|
||||||
|
|
||||||
|
# AutoKuma (auto-creates Kuma monitors from kuma.* container labels): your Kuma admin login
|
||||||
|
KUMA_USERNAME=admin
|
||||||
|
KUMA_PASSWORD=
|
||||||
|
|||||||
+30
-1
@@ -21,6 +21,15 @@ services:
|
|||||||
SITE_ADDRESS: ${SITE_ADDRESS:-:80}
|
SITE_ADDRESS: ${SITE_ADDRESS:-:80}
|
||||||
volumes: [caddy_data:/data, caddy_config:/config]
|
volumes: [caddy_data:/data, caddy_config:/config]
|
||||||
depends_on: [tracker]
|
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:
|
tracker:
|
||||||
build: { context: ., dockerfile: tracker/Dockerfile }
|
build: { context: ., dockerfile: tracker/Dockerfile }
|
||||||
@@ -31,6 +40,11 @@ services:
|
|||||||
SITE_HOST: ${SITE_HOST}
|
SITE_HOST: ${SITE_HOST}
|
||||||
volumes: ["./geoip:/data:ro"]
|
volumes: ["./geoip:/data:ro"]
|
||||||
depends_on: []
|
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:
|
linkcheck:
|
||||||
build: { context: ., dockerfile: tracker/Dockerfile }
|
build: { context: ., dockerfile: tracker/Dockerfile }
|
||||||
@@ -47,4 +61,19 @@ services:
|
|||||||
ports: ["${KUMA_BIND:-127.0.0.1:3001}:3001"]
|
ports: ["${KUMA_BIND:-127.0.0.1:3001}:3001"]
|
||||||
volumes: [kuma_data:/app/data]
|
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