Seafile Pro 9.09 (Docker) cannot connect to MySQL DB if PiHole uses port 53 of host (DNS)?

I am encountering a bizarre error here. I am running Seafile Pro 9.09 in a docker container on a Rocky Linux server. The seafile container works perfectly fine until I run my PiHole container, which takes up port 53 (both tcp and udp). Seafile only has port 8001 exposed, which is internally mapped to 80. The moment PiHole takes up port 53, I get a 502 Bad Gateway error on Seafile and an attempt to restart leads to this error message in the log Can't connect to MySQL server on 'db. The moment I bring down the PiHole container, it starts working. Another thing to note is that running PiHole on any other port works, but it seems to bug out on port 53 (DNS). Is there a reason for this? Does seafile need the host’s port 53 for some reason?

Side note, Rocky Linux (and other RHEL derivates) have podman instead of docker, but podman is 100% compliant with docker standards so that is something to rule out.

I don’t think this is related to Seafile nor some port conflict issue. Looks more like DNS resolution is overridden by pihole. Here could be starting point: Solve DNS Resolution in Other Containers when using Docker pihole - #5 by Cscanl - Community How-to's - Pi-hole Userspace

DNS resolution works just fine though. My devices uses the pihole as their DNS work fine. All my other containers work fine too. It’s just seafile that loses connection to the MySQL db the moment I turn on pihole. They aren’t even on the same network. Though I’ll give the pihole solution you linked a shot.

Thanks! That fixed it! Binding it to my VPN IP worked.