Can't access to server starting on 127.0.0.1 inside docker, but work with 0.0.0.0

I have container
docker run -d -p 3000:3000 -p 3001:3001 myapp

Inside container is running http server on 127.0.0.1:3001

Why can’t I get access from the outside to my 127.0.0.1:3001 http server inside docker.
But if I start http server on 0.0.0.0:3001 it works good for me.

I’m confused why it happen.

If you run a web server without Docker and bind it to 127.0.0.1 would you expect to have access through the “real” IP address of the host? If you bind your webserver to 127.0.0.1 inside a Docker container, you can only access it from inside.