warning msg="Failed to allocate and map port 53-53: Error starting userland proxy: listen udp4 192.168.50.11:53: bind: cannot assign requested address"
This message shows the port 53 is already being used when Pi-hole container tries to restart.
When you restart your machine, there is something else binding to this port.
When docker starts, the port is already taken.
It could be a service on the host, or maybe another container starting before Pi-hole.
I am only running two containers. pihole and wireguard. both automatically starts on startup. As far as I know 53 port isn't used by anyone since I can manually start failed pihole using docker-compose up -d and it works without any issue.
Note that if I change "192.168.50.11:53:53/udp" to "53:53/udp" then it works as expected and restarts automatically on reboot. so this seems like a docker specific issue.
I cannot confirm this:
I am unable to recreate your observation with an official Pi-hole image.
Rebooting my RPi 3A will also bring up the Pi-hole container without a glitch.
It is not just adding some blocklists.
The docker file you've linked is utilising apt-get to install packages, and it then downloads an installation script that applies further alterations to the image, potentially establishing new or altered dependencies that a vanilla Pi-hole image doesn't have.
That said, I notice that your docker-compose only binds port 53 UDP to a specific address:
What is the reason for that?
I am able to successfully reboot my RPi even with those unusual bindings, but nevertheless:
Did you try to bind port 53 TCP to your 192.168.50.11 as well?