Docker flask cant connect

Viewed 2425

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

  1. Looking at this post Deploying a minimal flask app in docker - server connection issues
  2. Running $ python app.py to make sure it works without docker
  3. Creating a django project and a dockerfile for that project. Then build, run and access.

So I am confident that docker is working and flask is working independently of each other, but I cannot get them to work together.

1 Answers
Related