Health Checks eingebaut

This commit is contained in:
hubobel 2026-01-11 16:58:25 +01:00
parent 61dca5242e
commit 613df62e32
5 changed files with 34 additions and 1 deletions

View file

@ -3,6 +3,11 @@ services:
image: grafana/grafana image: grafana/grafana
container_name: grafana container_name: grafana
restart: unless-stopped restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000/api/health" ]
interval: 5s
timeout: 3s
retries: 20
user: '0' user: '0'
ports: ports:
- '3000:3000' - '3000:3000'

View file

@ -2,6 +2,12 @@ services:
influxdb: influxdb:
image: influxdb:latest image: influxdb:latest
restart: unless-stopped restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8086/health" ]
interval: 5s
timeout: 3s
retries: 20
ports: ports:
- '8086:8086' - '8086:8086'
volumes: volumes:

View file

@ -3,6 +3,11 @@ services:
mqtt5: mqtt5:
image: eclipse-mosquitto image: eclipse-mosquitto
container_name: mqtt5 container_name: mqtt5
healthcheck:
test: [ "CMD-SHELL", "mosquitto_sub -h localhost -p 1883 -t '$SYS/#' -C 1 -W 2 >/dev/null 2>&1 || exit 1" ]
interval: 10s
timeout: 5s
retries: 12
ports: ports:
- "1883:1883" #default mqtt port - "1883:1883" #default mqtt port
- "9001:9001" #default mqtt port for websockets - "9001:9001" #default mqtt port for websockets

View file

@ -3,6 +3,11 @@ services:
image: docker.io/telegraf:latest image: docker.io/telegraf:latest
container_name: telegraf container_name: telegraf
restart: unless-stopped restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8094" ]
interval: 10s
timeout: 3s
retries: 12
environment: environment:
- MQTT_USERNAME=${MQTT_USERNAME} - MQTT_USERNAME=${MQTT_USERNAME}
- MQTT_PASSWORD=${MQTT_PASSWORD} - MQTT_PASSWORD=${MQTT_PASSWORD}

View file

@ -65,3 +65,15 @@
path = "tF" path = "tF"
rename = "tF" rename = "tF"
type = "float" type = "float"
[[inputs.mqtt_consumer]]
servers = ["tcp://mqtt5:1883"]
topics = ["daten/status/power/+"]
username = "${MQTT_USERNAME}"
password = "${MQTT_PASSWORD}"
data_format = "value"
data_type = "float"
name_override = "power"
topic_tag = "topic"