So, im using the tutorial/docs from DerFetzer on this link DHCP with docker-compose and bridge networking
I ended-up wiht a little different docker-compose running in a raspeberry pi 4 file as follow:
version: "3.7"
########################### NETWORKS
networks:
t2_proxy:
external:
name: t2_proxy
default:
driver: bridge
dhcp_relay_net:
ipam:
config:
- subnet: 172.32.0.0/16
########################### SERVICES
services:
pihole:
#image: pihole/pihole:latest
build: dockerfiles/pihole-unbound
container_name: pihole
hostname: pihole
domainname: $PIHOLE_NAME.$DOMAINNAME
ports:
- "53:53/tcp"
- "53:53/udp"
- "8181:80/tcp"
restart: unless-stopped
cap_add:
- NET_ADMIN
environment:
ServerIP: 192.168.0.10
WEBPASSWORD: $PWD
DNS1: 127.0.0.1#5335
DNS2: 127.0.0.1#5335
DNSMASQ_LISTENING: all
volumes:
- '$DOCKERDIR/pihole/pihole_data:/etc/pihole/'
- '$DOCKERDIR/pihole/dnsmasq.d:/etc/dnsmasq.d/'
depends_on:
- dhcphelper
networks:
dhcp_relay_net:
ipv4_address: 172.32.0.100
t2_proxy: {}
labels:
- "traefik.enable=true"
#sinkhole for port 80
- "traefik.http.routers.pihole80.rule=Host(`pihole.$DOMAINNAME`)"
- "traefik.http.routers.pihole80.service=pihole80@docker"
- "traefik.http.routers.pihole80.entrypoints=http"
- "traefik.http.services.pihole80.loadbalancer.server.port=80"
#sinkhole for port 443 by IP
- "traefik.http.routers.pihole443.rule=Host(`pihole.$DOMAINNAME`)"
- "traefik.http.routers.pihole443.service=pihole443@docker"
- "traefik.http.routers.pihole443.entrypoints=https"
- "traefik.http.routers.pihole443.tls=true"
- "traefik.http.services.pihole443.loadbalancer.server.port=80"
- "traefik.http.routers.pihole443.middlewares=chain-oauth@file" # Google OAuth 2.0
- "traefik.http.routers.pihole443.middlewares=admin-pihole@file" #addprefixadmin
dhcphelper:
build: dockerfiles/dhcp-helper
container_name: dhcphelper
restart: unless-stopped
network_mode: "host"
command: -s 172.32.0.100
cap_add:
- NET_ADMIN
Actual Behaviour:
Should be possible to ping and acess my pihole from the url https://pihole.mydomain
Actual Behaviour:
When i ping pihole.mydomain from any of my computer client I got the internal local ip address from pihole this means 172.32.0.100 so, I cant access the pihole using DNS.
But when I do 192.168.0.10:8181 it does show everything and works really well, a part from that, the pihole is working fine with traefik. Note the Traefik and Pihole are in the same Raspberry PI.
Debug Token:
s5zvov038n