Today I learned more about Docker and Python.

The blog post Connection refused? Docker networking and how it impacts your image gives an approachable overview over networking with Docker.

In the end you have to add the host with port to your docker config:

CMD ["flask", "run", "--host", ""]

Read more about Docker and Python on Itamar Turner-Tauring’s blog Python Speed.