title: Docker mongo image 'Connection refused' from other container
body: <p>I'm new to docker. I'm trying to create a MongoDB container and a NodeJS container. My file looks:</p>
  
  <pre><code>version: '2'
  services:
    backend:
      image: node:5.11-onbuild
      ports:
       - "3001:3001"
      volumes:
       - .:/code
      working_dir: "/code"
      links:
       - mongodb
    mongodb:
      image: mongo:3.3
      expose:
       - 27017
  </code></pre>
  
  <p>It should run <code>npm install</code> and then <code>node .</code>.
  But <code>docker-compose up</code> ends up with <code>[MongoError: connect ECONNREFUSED 127.0.0.1:27017]</code> while the command <code>node .</code>.
  I think this is because of the <code>bind_ip = 127.0.0.1</code> in the file <code>/etc/mongod.conf</code>. Is this right?</p>
  
  <p>I use boot2docker on a Win10 system.</p>
  
  <p>How can I solve this problem so that node can connect to the MongoDB?</p>