title: Docker: How do I debug localhost "Internal Server Error"?
body: <p>First time using Docker(version 19.03.5) and trying this <a href="https://github.com/docker/labs/blob/master/beginner/chapters/webapps.md#234-run-your-image" rel="nofollow noreferrer">tutorial</a> <br>
  I'm stuck on step 2.3.4 Running an image<br>
  When I go to <a href="http://localhost:8888" rel="nofollow noreferrer">http://localhost:8888</a> I see <br>
  <code>Internal Server Error
  The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</code></p>
  
  <p>I updated <code>Dockerfile</code> to this to match my directory:</p>
  
  <pre><code># our base image
  FROM alpine:3.5
  
  # Install python and pip
  RUN apk add --update py2-pip
  
  # install Python modules needed by the Python app
  COPY requirements.txt .
  RUN pip install --no-cache-dir -r requirements.txt
  
  # copy files required for the app to run
  COPY app.py .
  COPY templates/index.html templates
  
  # tell the port number the container should expose
  EXPOSE 5000
  
  # run the application
  CMD ["python", "app.py"]
  </code></pre>
  
  <p>On my command line I have <br>
  <code>C:\Users\user\docker\flask-app&gt;docker run  -p 8888:5000 --name flask-app 11111111/flask-app</code><br>
  <code>* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)</code><br><br>
  When I visit the page I see on the prompt<br>
  <code>172.17.0.1 - - [05/Jan/2020 07:14:34] "GET / HTTP/1.1" 500 -</code></p>
  
  <p><br><br>
  I have this in my app.py<br></p>
  
  <pre><code>from flask import Flask, render_template
  import random
  
  app = Flask(__name__)
  
  # list of cat images
  images = [
     "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26388-1381844103-11.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr01/15/9/anigif_enhanced-buzz-31540-1381844535-8.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26390-1381844163-18.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/10/anigif_enhanced-buzz-1376-1381846217-0.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr03/15/9/anigif_enhanced-buzz-3391-1381844336-26.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/10/anigif_enhanced-buzz-29111-1381845968-0.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr03/15/9/anigif_enhanced-buzz-3409-1381844582-13.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr02/15/9/anigif_enhanced-buzz-19667-1381844937-10.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26358-1381845043-13.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/9/anigif_enhanced-buzz-18774-1381844645-6.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/9/anigif_enhanced-buzz-25158-1381844793-0.gif",
      "http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr03/15/10/anigif_enhanced-buzz-11980-1381846269-1.gif"
      ]
  
  @app.route('/')
  def index():
      url = random.choice(images)
      return render_template('index.html', url=url)
  
  if __name__ == "__main__":
      app.run(host="0.0.0.0")
  </code></pre>
  
  <p>I can't figure out why my page isnt loading. Any help would be appreciated.</p>
  
  <p>Note: I have WAMP installed and this might be conflicting but not sure if thats the case and/or how to fix it.</p>