I have 2 different hosts:
A: Raspberry Pi 4. This is where Traefik, Pi-hole, etc, where all the ingress networking to my setup comes in from.
B: Desktop. This is running services like Jellyfin, Navidrome, etc. This host is not reverse proxied. The services ports are exposed directly in Docker.
I tried Docker swarm networking to get Traefik to work across hosts and couldn't figure it out so I'm resorting to using http routers to access them. They look something like this:
This works well enough and saved me a lot of headaches when dealing with Docker swarm however I would like to use the local domain silver.lan instead of the IP address. I already have host A set up to use Pi-hole local DNS and resolve silver.lan to 192.168.1.177. This works fine everywhere except when used in Traefik like below:
Attaching to the container and pinging silver.lan from inside also does not work. I believe I had something similar work when I used Nginx Proxy Manager but I can't remember entirely.
Am I missing something?
I found 2 solutions.
1: Add a Docker-compose extra_hosts: entry. It works but isn't ideal.
2: Put Traefik a same user-created network as Pi-hole (which has a static IP) and, in Docker-compose for Traefik, add a dns: entry which points to the Pi-hole container static IP on the shared network. This is a much better solution. Example below: