Dockerized Flask: Connection reset by peer
Trying to connect from outside fails


Are you actually connecting from outside? Flask is binding to localhost (127.0.0.1) and that will only be reachable from within the container. If you're on your local machine, you'll need flask to bind to all IP's:

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run(host='0.0.0.0')


That works for me successfully.