So i'm pretty new to traeffic and in the last fiew days i spend hours playing around with it on my raspberry pi on docker and reading different guides & documentation.
Now i finally got traefik to work (dashboard reachable on lan) and started working on connecting my first container to it. I decided to use pi hole for this because i kinda need a dns server for my planned (future) setup to work and i really like the idea of having a network wide ad-blocker.
I set everything up, started the new container and tryed reaching pi hole admin panel.
Sadly now i simply get a "404 page not found" from traefik. I tinkered around on my compose files of both containers for the last two days but i can't seem to get it to work.
I'm currently trying to get this to work without a dedicated sub domain but i'm simply unable to reach the admin page of pi hole via host-ip:80 or host-ip:80/admin
I would be really glad if somebody could take a look at my configuration and point me at the right direction because i'm pretty much lost at this point.
Traefik compose.yml
`##############################
Traefik compose file
##############################
version: "3.8"
services:
Reverse proxy
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
- dns
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/pi/docker/config/traefik:/etc/traefik
- /home/pi/docker/logs/traefik/:/logs
networks:
proxy:
external: true
dns:
external: true`
Pi hole compose.yml
`##############################
Pihole compose file
##############################
version: "3.8"
services:
DNS & network filter
pihole:
image: pihole/pihole:latest
container_name: pihole
restart: unless-stopped
environment:
TZ: 'Europe/Berlin'
WEBPASSWORD: 'test'
security_opt:
- no-new-privileges:true
networks:
- dns
- proxy
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/pi/docker/config/pihole/:/etc/pihole/
- /home/pi/docker/config/pihole/dnsmasq.d/:/etc/dnsmasq.d/
- /home/pi/docker/logs/pihole/pihole.log:/var/log/pihole.log
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
# HTTP
- "traefik.http.routers.pihole.entrypoints=web"
- "traefik.http.routers.pihole.service=pihole"
- "traefik.http.services.pihole.loadbalancer.server.port=80"
# TCP
- "traefik.tcp.routers.pihole.entrypoints=dns_tcp"
- "traefik.tcp.routers.pihole.rule=HostSNI(`*`)"
- "traefik.tcp.routers.pihole.service=dns_tcp"
- "traefik.tcp.services.dns_tcp.loadbalancer.server.port=53"
# UDP
- "traefik.udp.routers.pihole.entrypoints=dns_udp"
- "traefik.udp.routers.pihole.service=dns_udp"
- "traefik.udp.services.dns_udp.loadbalancer.server.port=53"
networks:
dns:
external: true
proxy:
external: true`
Traefik config.yml
`entryPoints:
dns_tcp:
address: ":53/tcp"
dns_udp:
address: ":53/udp"
web:
address: ":80"
web-secure:
address: ":443"
providers:
docker:
endpoint: unix:///var/run/docker.sock
watch: true
exposedByDefault: false
api:
dashboard: true
insecure: true`