title: Docker Compose build command using Cache and not picking up changed files while copying to docker
body: <p>I have a <code>docker-compose.yml</code> file comprising of two services (both based on a DockerFile). I have build the images once (using command: <code>docker-compose build</code>) and they were up and running once I ran this command (<code>docker-compose up</code>).<br>
  I had to change the source code used for one of the services, however, when I rebuilt the images (<code>docker-compose build</code>), the code changes were not reflected once I ran the services (<code>docker-compose up</code>).  </p>
  
  <p><strong>docker-compose.yml</strong>  </p>
  
  <pre><code>version: '2'
  
  services:
    serviceOne:
      build:
        context: ./ServerOne
        args:
            PORT: 4000
      ports:
        - "4000:4000"
      env_file:
        - ./ServerOne/.env
      environment:
        - PORT=4000
    serviceTwo:
      build:
        context: ./serviceTwo
        args:
            PORT: 3000
      ports:
        - "3000:3000"
      env_file:
        - ./serviceTwo/.env
      environment:
        - PORT=3000
        - serviceOne_URL=http://serviceOne:4000/
      depends_on:
        - serviceOne  
  </code></pre>
  
  <p><strong>serviceOne/DockerFile</strong>  </p>
  
  <pre><code>FROM node:8.10.0
  
  RUN mkdir -p /app
  WORKDIR /app
  ADD package.json package-lock.json /app/
  RUN npm install
  COPY . /app/
  RUN npm build
  EXPOSE ${ACC_PORT}
  CMD [ "npm", "start" ]
  </code></pre>
  
  <p><strong>serviceTwo/DockerFile</strong>  </p>
  
  <pre><code>FROM node:8.10.0
  
  RUN mkdir -p /app
  WORKDIR /app
  ADD package.json package-lock.json /app/
  RUN npm install
  COPY . /app/
  RUN npm build
  EXPOSE ${ACC_PORT}
  CMD [ "npm", "start" ]
  </code></pre>
  
  <p>Following is the output of the <code>docker-compose</code> when it is ran for the second time.<br>
  It is some how using the cached images again when <strong>COPY</strong> and <strong>npm build</strong> command are ran.  </p>
  
  <p>How could the <strong>DockerFile</strong> or <strong>docker-compose</strong> file be changed so that the new source code is deployed? </p>
  
  <p><a href="https://i.stack.imgur.com/tD59n.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tD59n.png" alt="enter image description here"></a></p>