title: docker-compose, failed to solve: rpc error: code = Unknown desc = failed to compute cache key: "/app/package.json" not found: not found
body: <p>I have a problem with pathways <code>docker-compose</code>, when I try build project with only <code>docker build</code>, it works great, but I mustn't use <code>docker build</code>, I have to use <code>docker-compose</code>. When I use <code>docker-compose</code> it returns 2 ERRORS at step 3/5 <code>=&gt; ERROR [3/5] COPY /app/package.json .</code>  and at step 5/5 <code>=&gt; ERROR [5/5] COPY /app .</code>:</p>
  <pre><code>PS C:\Users\mamba\Desktop\project-practice&gt; docker-compose -f docker/docker-compose.yml up -d
  [+] Building 1.4s (9/9) FINISHED
   =&gt; [internal] load build definition from Dockerfile                                                                                                          0.1s 
   =&gt; =&gt; transferring dockerfile: 31B                                                                                                                           0.0s 
   =&gt; [internal] load .dockerignore                                                                                                                             0.1s 
   =&gt; =&gt; transferring context: 34B                                                                                                                              0.0s 
   =&gt; [internal] load metadata for docker.io/library/node:latest                                                                                                1.0s 
   =&gt; [1/5] FROM docker.io/library/node@sha256:c3356b2b11ad643852a321308c15d70ca2bc106e40d3ffe7a4879d3588a9d479                                                 0.0s 
   =&gt; [internal] load build context                                                                                                                             0.1s 
   =&gt; =&gt; transferring context: 2B                                                                                                                               0.0s 
   =&gt; CACHED [2/5] WORKDIR /app                                                                                                                                 0.0s 
   =&gt; ERROR [3/5] COPY /app/package.json .                                                                                                                      0.0s 
   =&gt; CACHED [4/5] RUN npm install                                                                                                                              0.0s 
   =&gt; ERROR [5/5] COPY /app .                                                                                                                                   0.0s 
  ------
   &gt; [3/5] COPY /app/package.json .:
  ------
  ------
   &gt; [5/5] COPY /app .:
  ------
  failed to solve: rpc error: code = Unknown desc = failed to compute cache key: &quot;/app/package.json&quot; not found: not found
  </code></pre>
  <p>this is my project structure
  <a href="http://skrinshoter.ru/s/080721/upY64zwf" rel="noreferrer">http://skrinshoter.ru/s/080721/upY64zwf</a></p>
  <p>this is my Dockerfile</p>
  <pre><code>FROM node
  WORKDIR /app
  COPY /app/package.json .
  RUN npm install
  COPY /app .
  EXPOSE 3000
  CMD [&quot;npm&quot;, &quot;start&quot;]
  </code></pre>
  <p>this is my docker-compose.yml</p>
  <pre><code>version: &quot;3.8&quot;
  services: 
      react-app:
          working_dir: /app
          build: 
              dockerfile: Dockerfile
          ports: 
              - &quot;3000:3000&quot;
          volumes: 
              - ./app/src:/app/src
          environment: 
              - CHOKIDAR_USEPOLLING=true
          # env_file: 
          #     - ./docker/.env
  </code></pre>
  <p>If I move docker-compose.yml upper in structure of files to <code>project-practice</code>, it works great, it builds and server starts, but I have to keep structure of folders and files like this.</p>
  <pre><code>|-project-practice
  |-app
  |  |...
  |-docker
     |...
  </code></pre>