Error when using Streamlit with Docker

I have followed this tutorial here:
Deploy a Streamlit WebApp with Docker
And when I finally do:
docker run -p 8501:8501 app:latest
The application runs perfectly in my localhost:
However, I don’t know why they give me that Network URL. I cannot access from another device to this URL. Instead, I use the one that ifconfig returns me. Then, I can access to the streamlit app, but unfortunately it does not load:

I have tried from other devices and the result is the same.
If I run the app from PyCharm, then I can access to the app from other devices sucessfully.
Why does this happen?
How can I fix this?

You can find the solution here Ec2 streamlit stuck on loading screen while running streamlit hello.

For docker I solved with this docker-compose

version: "3"
    build: .
    command: "streamlit run src/ --server.enableCORS false"
      - "8501:8501"
      - "./src:/usr/src/app/src"

Using --server.enableCORS false made the magic.