docker-rpi/pihole/pihole.yaml
Maciej Krok 1c43b68661 pihole_exporter
master
2021-01-23 22:11:44 +01:00

83 lines
1.7 KiB
YAML

version: "3.4"
services:
pihole:
image: pihole/pihole
ports:
- target: 53
published: 53
protocol: tcp
mode: host
- target: 53
published: 53
protocol: udp
mode: host
- target: 67
published: 67
protocol: udp
mode: host
environment:
TZ: 'Europe/Warsaw'
DNS1: "8.8.8.8"
DNS2: "1.1.1.1"
cap_add:
- CAP_NET_BIND_SERVICE
- NET_ADMIN
networks:
- external
- internal
- traefik-net
volumes:
- pihole_etc:/etc/pihole/
- pihole_dnsmasq:/etc/dnsmasq.d/
- "/etc/resolv.conf:/etc/resolv.conf:ro"
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
delay: 5s
labels:
traefik.enable: "true"
traefik.frontend.rule: "Host:${HOST}"
traefik.port: 80
traefik.frontend.entryPoints: localhttp,localhttps
traefik.docker.network: traefik-net
traefik.frontend.headers.STSSeconds: 63072000
traefik.frontend.headers.STSIncludeSubdomains: "true"
traefik.frontend.headers.STSPreload: "true"
pihole_exporter:
image: ekofr/pihole-exporter:v0.0.11
environment:
PIHOLE_HOSTNAME: "pihole"
PIHOLE_API_TOKEN: "${PIHOLEAPITOKEN}"
INTERVAL: "30s"
PORT: "9617"
networks:
- internal
- prometheus_prometheus-net
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
delay: 5s
volumes:
pihole_dnsmasq:
pihole_etc:
networks:
external:
internal:
driver: overlay
internal: true
traefik-net:
external: true
prometheus_prometheus-net:
external: true
### Environment variables
# HOST
# PIHOLEAPITOKEN