Pointing a domain name to a loopback ip address like 127.0.0.1
will not work as this ip is different in each environment (host, virtual machine, container)
Since yit seems to be the same misunderstanding, I share my comment from another topic I wrote today
Click on the title for the picture at the end.