The app runs, but when I try to go to the link @ http://172.17.0.2:5000/ it times out.
relevant code:
app = Flask(__name__)
@app.route('/')
def index():
return "hullo"
I have also tried it with and without this code underneath which is what other stackoverflow responses to questions similar to mine have suggested, but it doesn't work:
if __name__ == '__main__':
app.run(host ='0.0.0.0')
Dockerfile:
FROM python:3.9.6-slim-buster
WORKDIR /project
RUN python -m pip install --upgrade pip
RUN pip install -U Flask Flask-WTF Flask-SQLAlchemy DateTime python-dotenv mysql-connector-python
COPY . .
CMD [ "python3", "-m" , "flask", "run", "--host", "0.0.0.0"]
Run cmd:
docker run --publish 5000:5000 testbon5
This is practically copy and pasted from the official docs tutorial. Is there something I'm doing wrong?