title: Flask API run on Docker but can't access
body: <p>I'm trying to run my API with Docker. I've managed to build and run it but, when I test it in Postman, it doesn't work.<br>
  I have a folder that contains uhopper.py(which is the API), requirements.txt and Dockerfile.<br>
  Everything seems to work but when I make a GET request on "<a href="http://127.0.0.1:5000/profile/john" rel="nofollow noreferrer">http://127.0.0.1:5000/profile/john</a>" it doesn't give a response and an error occurs ("There was an error connecting to <a href="http://127.0.0.1:5000/profile/john" rel="nofollow noreferrer">http://127.0.0.1:5000/profile/john</a>.")<br>
  I hope someone can help me, thanks in advance!</p>
  
  <p>uhopper.py</p>
  
  <pre><code>from flask import Flask, request
  from flask_restful import Resource, Api
  
  app = Flask(__name__)
  api = Api(app)
  
  john = {
      "http://en.wikipedia.org/wiki/Category:Writers_from_Belfast": 1,
      "http://en.wikipedia.org/wiki/Category:People_educated_at_Newstead_Wood_School": 2,
  }
  
  mac = {
      "http://en.wikipedia.org/wiki/Category:1998_establishments_in_New_York": 1,
      "http://en.wikipedia.org/wiki/Category:Public_Interest_Research_Groups": 1,
  }
  
  class Profile(Resource):
      def get(self, name):
          if name == 'john':
              return john, 200
          elif name == 'mac':
              return mac, 200
          return "Not found", 400
  
  api.add_resource(Profile, "/profile/&lt;string:name&gt;")
  
  if __name__ == '__main__':
      app.run(debug=True, host='0.0.0.0')
  </code></pre>
  
  <p>requirements.txt</p>
  
  <pre><code>Flask&gt;=1.1.1
  Flask-RESTful&gt;=0.3.7
  </code></pre>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM python:3.7
  
  WORKDIR /uhopper
  COPY . .
  
  RUN pip install -r requirements.txt
  
  ENTRYPOINT ["python"]
  CMD ["uhopper.py"]
  </code></pre>
  
  <p>This is my Git Bash:
  <a href="https://i.stack.imgur.com/Fxhoe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fxhoe.png" alt="enter image description here"></a></p>