title: Docker container in CircleCI not showing files even though volume appears mounted
body: <p>This is the docker-compose command and the results:</p>
  
  <pre><code>$ docker-compose -f docker-compose-base.yml -f docker-compose-test.yml run api sh -c 'pwd &amp;&amp; ls'
  Starting test-db ... done
  /usr/src/api
  node_modules
  </code></pre>
  
  <p>I then inspected the most recent container id:</p>
  
  <pre><code>$ docker inspect  --format='{{json .Mounts}}' e150beeef85c
  [
    {
      "Type": "bind",
      "Source": "/home/circleci/project",
      "Destination": "/usr/src/api",
      "Mode": "rw",
      "RW": true,
      "Propagation": "rprivate"
    },
    {
      "Type": "volume",
      "Name": "4f86174ca322af6d15489da91f745861815a02f5b4e9e879ef5375663b9defff",
      "Source": "/var/lib/docker/volumes/4f86174ca322af6d15489da91f745861815a02f5b4e9e879ef5375663b9defff/_data",
      "Destination": "/usr/src/api/node_modules",
      "Driver": "local",
      "Mode": "",
      "RW": true,
      "Propagation": ""
    }
  ]
  </code></pre>
  
  <p>Which means, these files are not appearing:</p>
  
  <pre><code>$ ls /home/circleci/project
  Dockerfile  docker-compose-base.yml  docker-compose-prod.yml  migrations     nodemon-debug.json  package-lock.json  src   test-db.env  tsconfig.build.json  tslint.json
  README.md   docker-compose-dev.yml   docker-compose-test.yml  nest-cli.json  nodemon.json        package.json       test  test.env     tsconfig.json
  </code></pre>
  
  <p>Why could this be?</p>
  
  <p><strong>Update:</strong> I should mention that all this works fine on my local dev environment. The above is failing on CircleCI.</p>
  
  <p>When I inspect the differences between the containers, the only major things that I see is that my dev environment runs Docker 19 using <code>overlay2</code> graph driver and the above failing environment runs Docker 17 using <code>aufs</code> graph driver.</p>
  
  <p><strong>Update 2:</strong> Actual docker-compose files:</p>
  
  <pre><code># docker-compose-base.yml
  version: '3'
  
  services:
    api:
      build: .
      restart: on-failure
      container_name: api
  </code></pre>
  
  <pre><code># docker-compose-test.yml
  version: '3'
  
  networks:
    default:
      external:
        name: lb_lbnet
  
  services:
    test-db:
      image: postgres:11
      container_name: test-db
      env_file:
        - ./test-db.env # uses POSTGRES_DB and POSTGRES_PASSWORD to create a fresh db with a password when first run
  
    api:
      restart: 'no'
      env_file:
        - test.env
      volumes:
        - ./:/usr/src/api
        - /usr/src/api/node_modules
      depends_on:
        - test-db
      ports:
        - 9229:9229
        - 3000:3000
      command: npm run start:debug
  
  </code></pre>
  
  <p>And finally <code>Dockerfile</code>:</p>
  
  <pre><code>FROM node:11
  
  WORKDIR /usr/src/api
  
  COPY package*.json ./
  
  RUN npm install
  
  COPY . .
  
  # not using an execution list here so we get shell variable substitution
  CMD npm run start:$NODE_ENV
  </code></pre>