Answer the question
In order to leave comments, you need to log in
Flask won't run from Docker container on localhost, what to do?
Hello, rummaged through the entire network, 4 hours, did not find an answer. I'm running Flask. everything works fine, on any port. And if you pack it in Docker and run it from a container. Does not work, eternal error ERR_EMPTY_RESPONSE.
In the dockerfile, I registered EXPOSE 5000 (I registered both 8000 and 80 and other ports)
In the flask file (I have only 1 file and that's it.) I registered many different ports and did not work at all, it does not help. For example, now it's like this
app.run(port="5000", debug=True)
UPD: Поставил Линукс, проблема осталась
Answer the question
In order to leave comments, you need to log in
Try specifying the host address as
host='0.0.0.0' in app.run
Since the flask is trying to listen on an internal interface that cannot be resolved from outside the container,
Looks like a windows problem
https://blog.sixeyed.com/published-ports-on-window...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question