title: Docker container not accessible in docker-compose
body: <p>I have a docker container based on node:10-alpine, it was working fine as individual container, but not in docker-compose. Even I exposed the port and set the network_mode, I couldn't visit it from <code>http://localhost:4000</code></p>
  
  <p>If I don't include <code>network_mode</code>, the nodejs server will be accessible on port 4000, but I will not have access to the other image's api.</p>
  
  <p>It was working perfectly on ubuntu, but somehow not working on mac (which runs against docker's goal). </p>
  
  <p>Dockerfile: </p>
  
  <pre><code>FROM node:10-alpine
  WORKDIR /usr/src/app
  COPY package*.json ./
  RUN npm install
  COPY . .
  EXPOSE 4000
  CMD ["npm", "start"]
  </code></pre>
  
  <p>docker-compose.yml:</p>
  
  <pre><code>version: '3'
  services:
    web:
      build: .
      ports:
        - "4000:4000"
      network_mode: host
    agebox:
      image: "another_image"
      ports:
        - "9000:8080"
  </code></pre>
  
  <p>I've tried to erase and rebuild everything multiple times, but still shows "The site can not be reached". Any suggestion on how to best resolve this issue?</p>