2021-03-28 13:50:02 +02:00
|
|
|
services:
|
|
|
|
|
|
|
|
grafana:
|
2022-02-18 14:55:15 +01:00
|
|
|
image: grafana/grafana:${GRAFANA_VERSION}
|
2021-03-28 13:50:02 +02:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- web
|
2021-03-28 15:47:32 +02:00
|
|
|
- grafana
|
2023-02-07 13:50:20 +01:00
|
|
|
- monitoring
|
2021-03-28 13:50:02 +02:00
|
|
|
labels:
|
|
|
|
- "traefik.enable=true"
|
|
|
|
- "traefik.http.routers.grafana.rule=Host(`monitoring.${DOMAIN}`)"
|
|
|
|
- "traefik.http.routers.grafana.entrypoints=websecure"
|
|
|
|
- "traefik.http.routers.grafana.tls.certresolver=netcup"
|
|
|
|
- "traefik.http.routers.grafana.tls.options=intermediate@file"
|
|
|
|
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
|
|
|
|
- "traefik.docker.network=web"
|
|
|
|
- "docker.group=monitoring"
|
|
|
|
environment:
|
|
|
|
- GF_DEFAULT_INSTANCE_NAME=monitoring.${DOMAIN}
|
|
|
|
- GF_SERVER_ROOT_URL=http://monitoring.${DOMAIN}
|
|
|
|
- GF_SERVER_DOMAIN=monitoring.${DOMAIN}
|
|
|
|
- GF_SERVER_SERVE_FROM_SUB_PATH=true
|
|
|
|
- GF_SECURITY_DISABLE_GRAVATAR=true
|
|
|
|
- GF_AUTH_ANONYMOUS_ENABLED=false
|
|
|
|
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
|
|
|
|
- GF_DATABASE_TYPE=postgres
|
|
|
|
- GF_DATABASE_HOST=grafanadb:5432
|
|
|
|
- GF_DATABASE_SSL_MODE=disable
|
|
|
|
- GF_DATABASE_NAME=grafana
|
|
|
|
- GF_DATABASE_USER=${POSTGRES_USER}
|
|
|
|
- GF_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
|
2023-02-07 13:50:20 +01:00
|
|
|
- GF_INSTALL_PLUGINS=flant-statusmap-panel,redis-datasource
|
2021-03-28 13:50:02 +02:00
|
|
|
depends_on:
|
|
|
|
- influxdb
|
|
|
|
- grafanadb
|
|
|
|
|
|
|
|
|
|
|
|
grafanadb:
|
2022-02-18 14:55:15 +01:00
|
|
|
image: postgres:${POSTGRES_VERSION}
|
2021-03-28 13:50:02 +02:00
|
|
|
volumes:
|
|
|
|
- ${VOLUMES_PATH}/grafanadb:/var/lib/postgresql/data
|
|
|
|
networks:
|
2021-03-28 15:47:32 +02:00
|
|
|
- grafana
|
2021-03-28 13:50:02 +02:00
|
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=grafana
|
|
|
|
- POSTGRES_USER=${POSTGRES_USER}
|
|
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
|
|
labels:
|
|
|
|
- "docker.group=monitoring"
|
|
|
|
|
|
|
|
|
|
|
|
influxdb:
|
2022-02-18 14:55:15 +01:00
|
|
|
image: influxdb:${INFLUXDB_VERSION}
|
2021-03-28 13:50:02 +02:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- web
|
2023-02-07 13:50:20 +01:00
|
|
|
- monitoring
|
|
|
|
- grafana
|
2021-03-28 13:50:02 +02:00
|
|
|
environment:
|
|
|
|
- INFLUXDB_MONITOR_STORE_ENABLED=false
|
|
|
|
volumes:
|
|
|
|
- ${VOLUMES_PATH}/influxdb/:/var/lib/influxdb
|
|
|
|
- ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf:ro
|
|
|
|
labels:
|
|
|
|
- "traefik.enable=true"
|
|
|
|
- "traefik.http.routers.influxdb.rule=Host(`influxdb.${DOMAIN}`)"
|
|
|
|
- "traefik.http.routers.influxdb.entrypoints=websecure"
|
|
|
|
- "traefik.http.routers.influxdb.tls.certresolver=netcup"
|
|
|
|
- "traefik.http.routers.influxdb.tls.options=intermediate@file"
|
|
|
|
- "traefik.http.services.influxdb.loadbalancer.server.port=8086"
|
|
|
|
- "traefik.http.routers.influxdb.middlewares=influxauth"
|
|
|
|
- "traefik.http.middlewares.influxauth.basicauth.users=${INFLUXDB_HTPASSWD}"
|
|
|
|
- "docker.group=monitoring"
|
|
|
|
|
|
|
|
|
2023-02-07 13:50:20 +01:00
|
|
|
prometheus:
|
|
|
|
image: prom/prometheus
|
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- grafana
|
|
|
|
- monitoring
|
|
|
|
- web # also used to get traefik metrics
|
|
|
|
volumes:
|
|
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
|
|
- ${VOLUMES_PATH}/prometheus:/prometheus
|
|
|
|
labels:
|
|
|
|
- "docker.group=monitoring"
|
|
|
|
|
2021-03-28 13:50:02 +02:00
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# here starts data collection
|
|
|
|
|
2021-03-28 15:47:32 +02:00
|
|
|
telegraf_host:
|
2022-02-18 14:55:15 +01:00
|
|
|
image: telegraf:${TELEGRAF_VERSION}
|
2021-03-28 13:50:02 +02:00
|
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
|
|
- HOST_MOUNT_PREFIX=/hostfs
|
|
|
|
- HOST_PROC=/hostfs/proc
|
|
|
|
- HOST_SYS=/hostfs/sys
|
|
|
|
- HOST_ETC=/hostfs/etc
|
|
|
|
- HOST_VAR=/hostfs/var
|
|
|
|
- HOST_RUN=/hostfs/run
|
|
|
|
env_file:
|
|
|
|
- ./.env # set environments into container
|
|
|
|
volumes:
|
2021-03-28 15:47:32 +02:00
|
|
|
- ./telegraf_host.conf:/etc/telegraf/telegraf.conf:ro
|
2021-03-28 13:50:02 +02:00
|
|
|
- /var/run/utmp:/var/run/utmp:ro
|
|
|
|
- /:/hostfs:ro
|
|
|
|
network_mode: "host"
|
|
|
|
labels:
|
|
|
|
- "docker.group=monitoring"
|
|
|
|
depends_on:
|
|
|
|
- influxdb
|
|
|
|
|
2023-02-07 13:50:20 +01:00
|
|
|
|
2021-03-28 15:47:32 +02:00
|
|
|
telegraf_net:
|
2022-02-18 14:55:15 +01:00
|
|
|
image: telegraf:${TELEGRAF_VERSION}
|
2021-03-28 15:47:32 +02:00
|
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
|
|
- ./telegraf_net.conf:/etc/telegraf/telegraf.conf:ro
|
|
|
|
networks:
|
2021-11-24 09:38:52 +01:00
|
|
|
- monitoring
|
|
|
|
- dockersocket
|
2021-03-28 15:47:32 +02:00
|
|
|
labels:
|
|
|
|
- "docker.group=monitoring"
|
|
|
|
depends_on:
|
|
|
|
- influxdb
|
|
|
|
|
2023-02-07 13:50:20 +01:00
|
|
|
|
2021-03-28 13:50:02 +02:00
|
|
|
networks:
|
2021-03-28 15:47:32 +02:00
|
|
|
grafana:
|
2021-03-28 13:50:02 +02:00
|
|
|
monitoring:
|
2021-03-28 15:47:32 +02:00
|
|
|
external: true
|
2021-03-28 13:50:02 +02:00
|
|
|
web:
|
|
|
|
external: true
|
2021-11-24 09:38:52 +01:00
|
|
|
dockersocket:
|
|
|
|
external: true
|