Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Docker / Docker Compose Support #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM golang:1.17

WORKDIR /go/src/app
COPY . .
RUN go get -d -v ./...
RUN go install -v ./...

CMD ["wireguard_exporter"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,11 @@ In `/etc/prometheus/prometheus.yml` add following config to the section `scrape_
static_configs:
- targets: ['localhost:9586']
```

## Docker / Docker Compose Usage

You can use the Dockerfile to build and run `wireguard_exporter` in a Docker
container.

For easier usage, you can also use the provided `docker-compose.yml` file for a
Docker Compose setup.
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'

services:
wireguard-exporter:
build: .
restart: unless-stopped
network_mode: host
volumes:
- /etc/wireguard/peers.toml:/etc/wireguard/peers.toml:ro
cap_add:
- NET_ADMIN
command: wireguard_exporter -wireguard.peer-file /etc/wireguard/peers.toml