iot-monitoring-stack/docker-compose.yml

95 lines
2.6 KiB
YAML

version: '3'
services:
grafana:
image: "grafana/grafana:latest"
restart: unless-stopped
user: "1000"
depends_on:
- influxdb
- timescaledb
ports:
- "${GRAFANA_PORT}:3000"
volumes:
- "${DATA_DIR}/grafana/data:/var/lib/grafana"
- "${DATA_DIR}/grafana/log:/var/log/grafana"
environment:
- GF_SECURITY_ADMIN_PASSWORD=secret
- GF_SERVER_ROOT_URL=http://${HOST_IP}:${GRAFANA_PORT}/
# - GF_RENDERING_SERVER_URL=http://renderer:8081/render
# - GF_RENDERING_CALLBACK_URL=http://grafana:3000/
- GF_LOG_FILTERS=rendering:debug
- GF_INSTALL_PLUGINS=ryantxu-ajax-panel,grafana-piechart-panel,marcusolsson-hourly-heatmap-panel
# renderer:
# image: grafana/grafana-image-renderer:latest
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
volumes:
- ./config/prometheus/prometheus.yml:/prometheus/prometheus.yml
- ${DATA_DIR}/prometheus/data:/prometheus/data
extra_hosts:
- "host.docker.internal:host-gateway"
command:
- '--storage.tsdb.retention.time=100d'
influxdb:
image: influxdb:latest
restart: unless-stopped
ports:
- "${INFLUX_PORT}:8086"
volumes:
- ${DATA_DIR}/influxdb:/var/lib/influxdb2
timescaledb:
image: timescale/timescaledb:latest-pg14
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${TIMESCALE_PASSWORD}
volumes:
- ${DATA_DIR}/timescale:/var/lib/postgresql/data
mqtt:
image: eclipse-mosquitto:latest
user: "1000"
ports:
- "${MQTT_PORT}:8883"
volumes:
- ./config/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
- ./config/mosquitto/users:/mosquitto/config/users
- ${DATA_DIR}/mosquitto/data:/mosquitto/data
- ${DATA_DIR}/mosquitto/log:/mosquitto/log
restart: unless-stopped
# The dongle does not actually work with odroid
# zigbee2mqtt:
# restart: unless-stopped
# image: koenkk/zigbee2mqtt
# volumes:
# - ${DATA_DIR}/zigbee2mqtt-data:/app/data
# - /run/udev:/run/udev:ro
# ports:
# - ${ZIGBEE_MQTT_PORT}:8080
# environment:
# - TZ=Europe/Berlin
# devices:
# - /dev/ttyUSB0:/dev/ttyUSB0
telegraf:
image: telegraf
restart: unless-stopped
depends_on:
- influxdb
- timescaledb
volumes:
- ./config/telegraf/:/etc/telegraf/
command:
- telegraf
- --config
- /etc/telegraf/telegraf.conf
- --config-directory
- /etc/telegraf/telegraf.d/