Pihole ist ein DNS-Server der die Namensaufloesung fuer Werbung und schaedliche Webseiten unterdrueckt. Ebenso kann man lokale Domaenen konfigurieren und aufloesen lassen was ich mit meiner beispiel.domain Domaene mache.
compose Datei
version: "3"
services:
pihole:
image: pihole/pihole:latest
# For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
ports:
- "83:80/tcp"
- "53:53/tcp"
- "53:53/udp"
environment:
TZ: Germany/Berlin
WEBPASSWORD: 'HIER_WEBPASSWORT_EINTRAGEN'
PIHOLE_DNS_: 9.9.9.9;149.112.112.112;1.1.1.1
DNSSEC: 'true'
ServerIP: 0.0.0.0 # Actual server IP. Matches DHCP conf file IP
VIRTUAL_HOST: pihole.beispiel.domain # Same as port traefik config
DNSMASQ_LISTENING: all
WEBTHEME: default-dark
PIHOLE_DOMAIN: n17.de
# WEBPASSWORD: set a secure password here or it will be random
# Volumes store your data between container upgrades
volumes:
- /docker/data/volumes/pihole/pihole:/etc/pihole
- /docker/data/volumes/pihole/dnsmasq.d:/etc/dnsmasq.d
networks:
- traefik_proxy
deploy:
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=true
- traefik.docker.network=traefik_proxy
- traefik.http.routers.pihole.rule=Host(`pihole.beispiel.domain`)
- traefik.http.routers.pihole.entrypoints=https
- traefik.http.routers.pihole.tls=true
- traefik.http.routers.pihole.service=srv82@file
- traefik.http.services.pihole.loadbalancer.server.port=82
networks:
traefik_proxy:
external: true
In traefik muss in der dynamic_conf.yml Konfiguration folgendes ergaenzt werden:
http:
middlewares:
secHeaders:
headers:
browserXssFilter: true
contentTypeNosniff: true
frameDeny: true
sslRedirect: true
#HSTS Configuration
stsIncludeSubdomains: true
stsPreload: true
stsSeconds: 31536000
customFrameOptionsValue: "SAMEORIGIN"
services:
srv82:
weighted:
healthCheck: {}
services:
- name: pihole1
weight: 2
- name: pihole2
weight: 1
pihole1:
loadBalancer:
healthCheck:
path: /admin
interval: 10s
timeout: 3s
servers:
- url: "http://172.17.200.77:83"
pihole2:
loadBalancer:
healthCheck:
path: /admin
interval: 10s
timeout: 3s
servers:
- url: "http://172.17.200.78:83"
Dies erzeugt einen Loadbalancer der prueft ob Pihole auf dockerman1 oder 2 laeuft und leitet Anfragen dann da hin.