I have a docker file for deploying my react project. Here is the
FROM node:14.2.0 COPY package.json /tmp/package.json RUN cd /tmp && npm install --silent RUN mkdir -p /home/node/app/ && cp -a /tmp/node_modules /home/node/app/ WORKDIR /home/node/app/ USER root COPY . ./
I believe if there is no change in
package.json it will use cache for npm install
(2nd step) and copying node_modules
But even if there is no change in
package.json it does not.
How do I cache the steps then ?
This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.