I was using Docker Desktop on MacOS.
I launched a postgres instance on host machine, so I chose to use network=host mode.
network=host
Here is my Dockerf
Dockerf