Having used docker on multiple occasions, I am familiar with the concepts of docker networks and port mapping. However, I haven't found any case online where you'd want to mix those two. Hopefully there are ppl who can help me out.
I use Traefik in many situations. I also have pi-hole software as private DNS. I would like to standardize all services behind Traefik to use TLS and custom (internal) domains. The pi-hole admin interface works perfectly together with Traefik.
The biggest issue with pi-hole behind an edge router, is docker uses NAT for the internal network. So pi-hole is not able to see where the DNS requests are made from. The only thing to overcome this is to map the DNS ports (53 & 853) directly to the host, I guess (so bypassing the internal Traefik network, bypassing any NAT).
I can attach the pi-hole container to multiple networks, but how I'm able to attach :80
to the Traefik network and :53
to the host network?
Eventually this was quite simple, although I didn't think this would work: simply publish the ports while the pi-hole container is connected to the Traefik network.
This is the Ansible config I used: