title: Connection slow from node to mongodb
body: <p>I'm experimenting with docker and reflected a very slow connection from the nodejs (4.2.3) container to mongodb (3.2) container.</p>
  
  <p>My setup, very basic, is this (docker-compose):</p>
  
  <pre><code>version: '2'
  
  services:
    web:
      build: ./app
      volumes:
        - "./app:/src/app"
      ports:
        - "80:3000"
      links:
        - "db_cache:redis"
        - "db:mongodb"
      command: nodemon -L app/bin/www
  
    db_cache:
      image: redis
    db:
      image: mongo
  </code></pre>
  
  <p>My s.o. is OSX 10.10 and the docker version is 1.10.2.</p>
  
  <p>The strange thing is that the connection time to the db is always 30 seconds.</p>
  
  <p>Is there any automatic delay?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>if I set ip address of mongodb container intead a "dns" (<code>mongodb</code>), the delay disappears!</p>
  
  <p>Any ideas?</p>