Files
ethereum-rpc-docker/monitoring.yml
2022-03-16 14:19:59 +01:00

114 lines
2.7 KiB
YAML

version: '3.1'
services:
### WIREGUARD
wireguard:
image: lscr.io/linuxserver/wireguard
container_name: wireguard
healthcheck:
test: [ "CMD", "ping", "-c", "1", "10.13.13.1" ]
timeout: 10s
interval: 5s
retries: 3
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=1000
- PGID=1000
volumes:
- ./wireguard/config/wg0.conf:/config/wg0.conf
- /lib/modules:/lib/modules
# Expose prometheus port
expose:
- 9090
ports:
- 51820:51820/udp
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
### MONITORING
prometheus:
image: prom/prometheus:v2.30.3
container_name: prometheus
volumes:
- ./prometheus/prometheus-autodiscover.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus:rw
- prometheus-docker-sd:/prometheus-docker-sd:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
restart: unless-stopped
expose:
- 9090
ports:
- 127.0.0.1:9090:9090
networks:
- chains
labels:
org.label-schema.group: "monitoring"
depends_on:
- prometheus-docker-sd
# network_mode: "service:wireguard"
# depends_on:
# - wireguard
prometheus-docker-sd:
image: "stucky/prometheus-docker-sd:latest"
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- prometheus-docker-sd:/prometheus-docker-sd:rw
nodeexporter:
image: prom/node-exporter:v1.2.2
container_name: nodeexporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
restart: unless-stopped
expose:
- 9100
labels:
org.label-schema.group: "monitoring"
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.42.0
container_name: cadvisor
privileged: true
devices:
- /dev/kmsg:/dev/kmsg
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
#- /cgroup:/cgroup:ro #doesn't work on MacOS only for Linux
restart: unless-stopped
expose:
- 8080
labels:
org.label-schema.group: "monitoring"
### VOLUMES
volumes:
prometheus_data:
prometheus-docker-sd: