MindFlavor / prometheus_wireguard_exporter

A Prometheus exporter for WireGuard, written in Rust.
https://mindflavor.github.io/prometheus_wireguard_exporter
MIT License
492 stars 51 forks source link

Example docker compose setup #129

Closed iTrooz closed 2 months ago

iTrooz commented 2 months ago

Hey, for anyone looking for a simple docker compose setup, here is one:

services:
  wg-exporter:
    image: mindflavor/prometheus-wireguard-exporter
    network_mode: host
    command: -a true # See https://github.com/MindFlavor/prometheus_wireguard_exporter/issues/99
    user: root # To be able to read wireguard config file
    environment:
      - PROMETHEUS_WIREGUARD_EXPORTER_CONFIG_FILE_NAMES=/etc/wireguard/wg.conf
    expose:
      - "9586"
    volumes:
      - /etc/wireguard:/etc/wireguard:ro
    cap_add:
      - NET_ADMIN