Files
docker/monitoring/docker-compose.yaml

164 lines
4.4 KiB
YAML

version: "3.9"
networks:
proxy:
external: true
monitoring:
name: monitoring
external: false
volumes:
telegraf:
name: telegraf
influx:
name: influx
influx-etc:
name: influx-etc
prometheus:
name: prometheus
services:
apc:
image: cs-registry.ddnss.de/home/apc
container_name: apc
hostname: apc
tty: true
devices:
- /dev/usb/hiddev0
networks:
- proxy
- monitoring
labels:
- "traefik.enable=true"
- "traefik.http.routers.apc.rule=Host(`apc.lan`)"
- "traefik.http.routers.apc.entrypoints=web"
- "traefik.http.routers.apc.service=apc"
- "traefik.http.services.apc.loadbalancer.server.port=80"
ports:
- "3551:3551/tcp"
- "3551:3551/udp"
restart: unless-stopped
glances:
image: nicolargo/glances:latest-full
restart: unless-stopped
hostname: glances
container_name: glances
pid: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- "GLANCES_OPT=-w"
networks:
- proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.glances.rule=Host(`glances.lan`)"
- "traefik.http.routers.glances.entrypoints=web"
- "traefik.http.routers.glances.service=glances"
- "traefik.http.services.glances.loadbalancer.server.port=61208"
telegraf:
image: telegraf:alpine
container_name: telegraf
hostname: telegraf
networks:
- monitoring
user: telegraf:998
volumes:
- telegraf:/etc/telegraf/
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- influx
influx:
image: influxdb:alpine
container_name: influx
hostname: influx
volumes:
- influx:/var/lib/influxdb2
- influx-etc:/etc/influxdb2
networks:
- proxy
- monitoring
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.influx.rule=Host(`influx.lan`)"
- "traefik.http.routers.influx.entrypoints=web"
- "traefik.http.routers.influx.service=influx"
- "traefik.http.services.influx.loadbalancer.server.port=8086"
prometheus:
image: cs-registry.ddnss.de/home/prometheus
container_name: prometheus
hostname: prometheus
restart: unless-stopped
networks:
- proxy
volumes:
- prometheus:/prometheus
labels:
- "traefik.enable=true"
- "traefik.http.routers.prometheus.rule=Host(`prometheus.lan`)"
- "traefik.http.routers.prometheus.entrypoints=web"
- "traefik.http.routers.prometheus.service=prometheus"
- "traefik.http.services.prometheus.loadbalancer.server.port=9090"
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
hostname: cadvisor
restart: unless-stopped
networks:
- proxy
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.cadvisor.rule=Host(`cadvisor.lan`)"
- "traefik.http.routers.cadvisor.entrypoints=web"
- "traefik.http.routers.cadvisor.service=cadvisor"
- "traefik.http.services.cadvisor.loadbalancer.server.port=8080"
node_exporter:
image: prom/node-exporter
container_name: node_exporter
command:
- '--path.rootfs=/host'
networks:
- proxy
pid: host
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
labels:
- "traefik.enable=true"
- "traefik.http.routers.node-exporter.rule=Host(`node-exporter.lan`)"
- "traefik.http.routers.node-exporter.entrypoints=web"
- "traefik.http.routers.node-exporter.service=node-exporter"
- "traefik.http.services.node-exporter.loadbalancer.server.port=9100"
watchtower:
image: containrrr/watchtower
container_name: watchtower
hostname: watchtower
restart: unless-stopped
networks:
- monitoring
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./watchtower-config.json:/config.json
environment:
WATCHTOWER_INCLUDE_STOPPED: true
WATCHTOWER_MONITOR_ONLY: true
WATCHTOWER_SCHEDULE: "0 20 8 * * *"
WATCHTOWER_NOTIFICATIONS: "shoutrrr"
WATCHTOWER_NOTIFICATION_URL: "mattermost://watchtower@cs-mm.ddnss.de/og4ckuqet7fafb8kjuaigzuh7c"
WATCHTOWER_NOTIFICATION_TEMPLATE: "{{range .}}{{.Time.Format \"2006-01-02 15:04:05\"}} ({{.Level}}): {{.Message}}{{println}}{{end}}"