title: debugging containerised python web app
body: <p>I have made this first docker container, and it works as per the <code>Dockerfile</code>.</p>
  
  <pre><code>FROM python:3.5-slim
  
  RUN apt-get update &amp;&amp; \
      apt-get -y install gcc mono-mcs &amp;&amp; \
          apt-get -y install vim &amp;&amp; \
          apt-get -y install nano &amp;&amp; \
              rm -rf /var/lib/apt/lists/*
  
  RUN mkdir -p /statics/js
  
  VOLUME ["/statics/"]
  
  WORKDIR /statics/js
  
  COPY requirements.txt /opt/requirements.txt
  
  RUN pip install -r /opt/requirements.txt
  
  EXPOSE 8080
  
  CMD ["python", "/statics/js/app.py"]
  </code></pre>
  
  <p>after running this command:</p>
  
  <blockquote>
    <p>docker run -it -p 8080:8080 -v
    ~/Development/my-Docker-builds/pythonReact/statics/:/statics/ -d 
    ciasto/pythonreact:v2</p>
  </blockquote>
  
  <p>and when I open the page <code>localhost:8080</code> i get error:</p>
  
  <pre><code>A server error occurred.  Please contact the administrator.
  </code></pre>
  
  <p>but if I run <a href="https://github.com/sanfx/pythonReact/blob/master/statics/js/app.py" rel="nofollow noreferrer">this application</a> normally, i.e. not containerised directly on my host machine: it works fine.</p>
  
  <p>So I want to know what is causing server error. How do I debug a python app that runs via container to know what is causing it to not work. or what am I doing wrong.</p>