title: How to start flask server with docker run and use it on host?
body: <p>I have a flask script which I try to execute it via docker run command. Following command i am doing</p>
  
  <pre><code>docker run -dit -v /media/sf_MY_WINDOWS/GitRepo/:/ext/GitRepo -p 5000:5000 "isbhatt/prefixman:v1" /ext/docker/vm_scripts/db_loader.sh
  </code></pre>
  
  <p>and db_loader.sh file contains</p>
  
  <pre><code>/usr/local/bin/python2.7 /ext/SDSNG/src/prefix_manager/manage.py runserver --host 0.0.0.0 &amp;
  </code></pre>
  
  <p>but when I do curl localhost:5000 Connection refused.
  If I go into container and run the stuff and do curl localhost:5000 it works in container..
  What is wrong here?</p>
  
  <p>Output of netstat -tln on container</p>
  
  <pre><code>Active Internet connections (only servers)
  Proto Recv-Q Send-Q Local Address               Foreign Address             State      
  tcp        0      0 0.0.0.0:5000                0.0.0.0:*                   LISTEN  
  </code></pre>