From a container you can not simply access 127.0.0.1 of your host. That’s what containers are for: isolation.
It only works when your are in network: host mode, but then all open ports of the container are exposed externally.
This is asked like every other day, check this post.