title: Running django tests with selenium in docker
body: <p>For executing tests I usually run a separate container with:</p>
  
  <pre><code>docker-compose run --rm web /bin/bash
  </code></pre>
  
  <p>Where web is a container with django. From a shell I execute py.test from time to time.</p>
  
  <p>In order to be able to reach selenium from a container with django and to allow the browser from selenium container to reach django's liveserver I decided to use "net" parameter which allows containers to share net. So I added it to the yml:</p>
  
  <pre><code>selenium:
      image: selenium/standalone-firefox
      net: "container:web"
  </code></pre>
  
  <p>Unfortunately this does not work. I do not see 4444 port in my django container.</p>
  
  <p>It only works if instead of <code>net:"container:web"</code> I specify an autogenerated container's name, like <code>net:"container:project_web_run_1"</code>.</p>
  
  <p>Also I tried instead of <code>docker-compose run --rm ....</code> use <code>docker-compose up --no-deps</code> changing <code>command</code> parameter to <code>py.test functional_tests</code> but that did not work either.</p>
  
  <p>Is this the right of using selenium with containers?</p>