Hi - is there any way to cache npm install for changes to package.json - ie. with an optimised Dockerfile, I do the following, but any add/remove from dependencies in package.json causes an entire reinstall?
COPY package.json . RUN npm install COPY . .
Note the 2nd copy (COPY . .) is the source, which isnt copied over anywhere in the dockerfile before the COPY package.json.
I could look into using a local npm cache onto the host, but have tried this & not immediately working (times out looking for the cache).