title: Docker gets Flask server running, but I can't connect to it with my browser
body: <p>I am trying to run my flask application through Docker. I had it working last week, but now it is giving me some issues. I can start the server, but I can't seem to visit any content through my browser.</p>
  
  <p>Here is my <code>app.py</code> file (reduced):</p>
  
  <pre><code>... imports ...
  app = Flask(__name__)
  DATABASE = "users.db"
  app.secret_key = os.environ["SECRET_KEY"]
  app.config['UPLOAD_FOLDER'] = 'static/Content'
  
  BASE_PATH = os.path.dirname(os.path.abspath(__file__))
  
  # For Dropbox
  __TOKEN = os.environ["dbx_access_token"]
  __dbx = None 
  
  ... functions ...
  
  
  if __name__ == '__main__':
       app.run(port=5001, threaded=True, host=('0.0.0.0'))
  </code></pre>
  
  <p>Here is my <code>Dockerfile</code>:</p>
  
  <pre><code># Use an official Python runtime as a parent image
  FROM python:3
  
  # Set the working directory to /VOSW-2016-original
  WORKDIR /VOSW-2016-original
  
  # Copy the current directory contents into the container at /VOSW-2016-original
  ADD . /VOSW-2016-original
  
  # Putting a variables in the environment
  ENV SECRET_KEY="XXXXXXXX"
  ENV dbx_access_token="XXXXXXXX"
  
  # Install any needed packages specified in requirements.txt
  RUN pip install --trusted-host pypi.python.org -r requirements.txt
  
  # Make port 8000 available to the world outside this container
  EXPOSE 8000
  
  # Run app.py when the container launches
  CMD ["python", "app.py", "--host=0.0.0.0"]
  </code></pre>
  
  <p>Here are the commands I am using to start the server:</p>
  
  <pre><code>docker build -t vosw_original ./VOSW-2016-original/
  </code></pre>
  
  <p>and then:</p>
  
  <pre><code>docker run -i -t -p 5001:8000 vosw_original
  </code></pre>
  
  <p>Then I get the message:</p>
  
  <pre><code>* Running on http://0.0.0.0:5001/ (Press CTRL+C to quit)
  </code></pre>
  
  <p>So the server seems to be running, but I can't seem to visit it when I do any of the following:</p>
  
  <ol>
  <li><code>http://0.0.0.0:5001/</code></li>
  <li><code>http://0.0.0.0:8000/</code></li>
  <li><code>http://127.0.0.1:5001/</code></li>
  <li><code>http://127.0.0.1:8000/</code></li>
  </ol>
  
  <p>Where am I going wrong?</p>