Reputation: 1697
I am trying to do http://containertutorials.com/docker-compose/flask-simple-app.html
I have copied the tutorial verbatim, except I changed
From flask import Flask
to
from flask import Flask
I can built it just fine. I can start it and get the following when I run docker ps from the command line
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
291c8dfe5ddb whatever:latest "python app.py" About a minute ago Up About a minute 0.0.0.0:5000->5000/tcp sick_wozniak
I am building this on OSX
I have tried the following
So I am confident that docker is working and flask is working independently of each other, but I cannot get them to work together.
Upvotes: 4
Views: 2465
Reputation: 191743
If on Linux, then http://localhost:5000
should work seeing as the container is both running and listening on port 5000.
Otherwise, you would be using Docker Machine, and so you need to get the IP of the docker virtual machine using docker-machine ip
. On OSX, for example
$ open http://$(docker-machine ip default):5000
Upvotes: 8