Pi-hole, Home Assistant and some media servers work best when they look like a separate device on the network. A macvlan network gives a container its own MAC address and an IP from your LAN.
docker network create -d macvlan \
--subnet 192.0.2.0/24 --gateway 192.0.2.1 \
--ip-range 192.0.2.192/27 \
-o parent=eth0 lan
docker run -d --name pihole --network lan --ip 192.0.2.200 example/pihole:1.0
Use your own LAN’s subnet and gateway, and the name of the host’s network card as parent. The --ip-range keeps Docker inside a block your router’s DHCP does not hand out, which I would also reserve in the router.
No port publishing is needed; the container answers on all its ports at its own address, just like another machine on the network.
The host itself cannot talk to its macvlan containers by default. The Linux kernel blocks traffic between the parent interface and its macvlan children, so a container on the host network or the host’s own shell cannot reach the Pi-hole. The usual workaround is a small macvlan interface on the host. Wi-Fi interfaces and many virtual machine setups refuse extra MAC addresses, so macvlan works best on a wired network card. Unraid users who see call traces can switch to ipvlan.
Further reading: Macvlan network driver