How to run Python Flask within a Docker container [duplicate]
This question already has an answer here:
One Solution collect form web for “How to run Python Flask within a Docker container [duplicate]”
By default, Flask server is only accessible from the localhost. In your case, the container is the localhost, and your requests are originating from outside the container.
host='0.0.0.0' parameter makes the server accessible from external IPs. It’s described in Flask documentation in detail.