I've just started learning docker and I'm trying to run a very simple flask server in a container. Whenever I run it, it works just fine. However, when I access the website, chrome displays this:
This page isn’t working
127.0.0.1 didn’t send any data.
ERR_EMPTY_RESPONSE
Here is my code:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "Hello World"
if __name__ == "__main__":
app.run(debug=True)
The Dockerfile:
FROM python:3
RUN mkdir /test
WORKDIR /test
RUN pip3 install flask
COPY . .
EXPOSE 5000
cmd ["python3", "application.py"]
And the commands I'm using to build the image and run the container:
docker build . -t test
docker start -p 5000:5000 test
Could someone help me figure this out?