title: Dockerize a node express app with docker-compose
body: <p>I've got a node app that I can run locally using <code>npm run</code>. It is using express as the server and uses browser sync to show hot reloads.</p>
  
  <p>Express is using port <code>6001</code><br>
  Browsersync is using ports <code>3000</code> and <code>3001</code></p>
  
  <p><strong>Docker file</strong>  </p>
  
  <pre><code>FROM node/argon
  
  WORKDIR /usr/src/app
  
  COPY package.json /usr/src/app/
  RUN npm install
  ENV PATH /usr/src/app/node_modules/.bin:$PATH
  
  USER app
  COPY . /usr/src/app
  RUN sudo chown -R app /usr/src/app
  RUN npm start
  EXPOSE 6001
  CMD ["npm", "start"]
  </code></pre>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>web:
    extends:
      file: docker-compose-base.yml
      service: web
    ports:
      - "6001:6001"
    environment:
      VIRTUAL_HOST: testing.docker
  </code></pre>
  
  <p><strong>docker-compose-base.yml</strong></p>
  
  <pre><code>web: 
    build: .
    command: npm start
    volumes:
      - .:/usr/src/app
      - /usr/src/app
      - /usr/src/app/node_modules
  </code></pre>
  
  <p>I can run <code>docker-compose build</code> and it builds just fine, running <code>docker-compose up</code> spits out the following:</p>
  
  <pre><code>[BS] Access URLs:
   ----------------------------
   Local: http://localhost:3000
   ----------------------------
      UI: http://localhost:3001
   ----------------------------
  Listening on http://localhost:6001
  </code></pre>
  
  <p>But accessing <code>http://testing.docker</code> appears as though the container never mounted. Running <code>docker-compose ps</code> shows no containers, but running <code>docker ps</code> shows the container is available.</p>
  
  <p>I'm completely at a loss.</p>