home-monitoring/compose.yaml

41 lines
1.2 KiB
YAML

services:
home-monitor:
image: python:3.13-slim
container_name: home-monitor
restart: unless-stopped
working_dir: /app
command: ["/bin/sh", "-c", "pip install --disable-pip-version-check -r /app/requirements.txt && exec python -u /app/collector.py"]
volumes:
- ./collector.py:/app/collector.py:ro
- ./requirements.txt:/app/requirements.txt:ro
- /app-config/home-monitoring/pip-cache:/root/.cache/pip
environment:
TZ: Europe/Berlin
MQTT_HOST: 10.10.1.1
MQTT_PORT: "1883"
MQTT_TOPICS: "#,$$SYS/#"
INFLUX_URL: http://influxdb:8086
INFLUX_ORG: influx.sascha-lutz.de
INFLUX_BUCKET: telegraf
INFLUX_TOKEN: ${INFLUX_TOKEN}
BUTLER_URL: http://10.4.1.116:8888
BUTLER_TOKEN: ${BUTLER_TOKEN}
WRITE_INTERVAL: "15"
TOPIC_STATS_INTERVAL: "300"
HA_POLL_INTERVAL: "60"
MAX_TOPICS: "500"
HEALTH_PORT: "9199"
expose:
- "9199"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:9199/health', timeout=3)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
networks:
- monitoring_network
networks:
monitoring_network:
external: true