the following fixed it, just add
extra_hosts: - "yourdomain.com:172.XX.0.1"
make sure to use the exact domain name and exact docker network gateway ex. 172.18.0.1, recheck after deployment, sometimes the network gets new IP (gateway).