Start docker with flask application using ssl [duplicate] Start docker with flask application using ssl [duplicate] flask flask

Start docker with flask application using ssl [duplicate]


This is a rather easy fix, you have to change this line:

app.run(debug=True, host='127.0.0.1', port=5000, ssl_context=ctx)

to

app.run(debug=True, host='0.0.0.0', port=5000, ssl_context=ctx)

You have to think from the containers' perspective: The container has its own "localhost", which is different from the localhost of the host machine, all of that means that flask has never received the request.

Therefore you can simply bind to all IPs within the container, which is done by binding to "0.0.0.0".