title: docker-compose ip/hostname for the host machine
body: <p>I have a following docker-compose file:</p>
  
  <pre><code>nginx:
      image: nginx
      hostname: myservice.local
      volumes:
          - nginx.local.conf:/etc/nginx/conf.d/myservice.conf
      container_name: goout-nginx
  </code></pre>
  
  <p>Is there a way for docker-compose to set the myservice.local for the host machine as well? At the moment calling this on the host machine doesn't do anything:</p>
  
  <pre><code>$ ping myservice.local
  ping: cannot resolve myservice.local: Unknown host
  </code></pre>
  
  <p>I don't want to manually update local <code>/etc/hosts</code> for such thing.</p>
  
  <p>EDIT:</p>
  
  <p>My problem seems to be more complex then I previously thought. I am trying to create a development setup for my colleagues which they could run locally on their machines.</p>
  
  <p>This should be an easily-runnable application running on <code>80/443</code> ports in the browser. This cannot run on the <code>localhost:80/443</code> as these ports are already taken and used by apache on their machines. To do that I want the running machine to have assigned IP address so they could just interact with the application just by opening <code>myservice.local</code>. This doesn't have to be accessible to the outside world, only the host machine.</p>
  
  <p>The setup should be super simple - I was hoping all this could be achieved just by running <code>docker-compose up</code> – I was hoping to avoid any complicated setup of networking, IP tables or /etc/hosts.</p>