Advertisement
PhoenyxRLP

docker-compose-prometheus-grafana

Jan 14th, 2023
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.35 KB | Source Code | 0 0
  1. version: '2.5'
  2.  
  3. services:
  4.   mon_prometheus:
  5.     image: prom/prometheus:latest
  6.     container_name: mon_prometheus
  7.     restart: unless-stopped
  8.     volumes:
  9.      - ../prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
  10.     depends_on:
  11.      - mon_node-exporter
  12.       - mon_cadvisor
  13.     networks:
  14.       backend:
  15.         ipv4_address: 172.30.0.2
  16.  
  17.   mon_node-exporter:
  18.     image: prom/node-exporter:latest
  19.     container_name: mon_node-exporter
  20.     restart: unless-stopped
  21.     volumes:
  22.      - /proc:/host/proc:ro
  23.       - /sys:/host/sys:ro
  24.       - /:/rootfs:ro
  25.     command:
  26.      - '--path.procfs=/host/proc'
  27.       - '--path.sysfs=/host/sys'
  28.       - '--path.rootfs=/rootfs'
  29.       - '--collector.filesystem.ignored-mount-points="^(/rootfs|/host|)/(sys|proc|dev|host|etc)($$|/)"'
  30.       - '--collector.filesystem.ignored-fs-types="^(sys|proc|auto|cgroup|devpts|ns|au|fuse\.lxc|mqueue)(fs|)$$"'
  31.     networks:
  32.       backend:
  33.         ipv4_address: 172.30.0.3
  34.  
  35.   mon_cadvisor:
  36.     image: gcr.io/cadvisor/cadvisor
  37.     container_name: mon_cadvisor
  38.     restart: unless-stopped
  39.     volumes:
  40.      - /:/rootfs:ro
  41.       - /var/run:/var/run:rw
  42.       - /sys:/sys:ro
  43.       - /var/lib/docker/:/var/lib/docker:ro
  44.     networks:
  45.       backend:
  46.         ipv4_address: 172.30.0.4
  47.  
  48.   mon_grafana:
  49.     image: grafana/grafana:latest
  50.     container_name: mon_grafana
  51.     restart: unless-stopped
  52.     volumes:
  53.      - /opt/containers/grafana/grafana:/var/lib/grafana
  54.     #user: "1000"
  55.     depends_on:
  56.      - mon_prometheus
  57.     labels:
  58.      - "traefik.enable=true"
  59.       - "traefik.http.routers.grafana.entrypoints=https"
  60.       - "traefik.http.routers.grafana.rule=(Host(`grafana.meinedomain.tld`))"
  61.       - "traefik.http.routers.grafana.tls=true"
  62.       - "traefik.http.routers.grafana.tls.certresolver=http"
  63.       - "traefik.http.routers.grafana.service=grafana"
  64.       - "traefik.http.services.grafana.loadbalancer.server.port=3000"
  65.       - "traefik.docker.network=proxy"
  66.       - "traefik.http.routers.grafana.middlewares=default@file"  
  67.     networks:
  68.       proxy:
  69.         ipv4_address: 172.18.0.5
  70.         ipv6_address: 2a03:****:**:***:2::5
  71.       backend:
  72.         ipv4_address: 172.30.0.5
  73.  
  74. networks:
  75.   proxy:
  76.     external: true
  77.   backend:
  78.     name: backend
  79.     driver: bridge
  80.     ipam:
  81.       config:
  82.       - subnet: 172.30.0.0/24
  83.         gateway: 172.30.0.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement