ethereum: only invalidate npm install if package.json changed
Thanks Lorenz :D
This commit is contained in:
parent
8174679360
commit
b7512c9203
|
@ -10,7 +10,8 @@ RUN mkdir -p /home/node/app
|
|||
RUN mkdir -p /home/node/.npm
|
||||
WORKDIR /home/node/app
|
||||
|
||||
ADD --chown=node:node . .
|
||||
# Only invalidate the npm install step if package.json changed
|
||||
ADD --chown=node:node package.json .
|
||||
|
||||
# We want to cache node_modules *and* incorporate it into the final image.
|
||||
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
|
||||
|
@ -22,3 +23,5 @@ RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
|
|||
# the target is on a different fs and does a full recursive copy for what
|
||||
# could be a renameat syscall. Alpine does not have this bug.
|
||||
RUN rmdir node_modules && mv node_modules_cache node_modules
|
||||
|
||||
ADD --chown=node:node . .
|
||||
|
|
Loading…
Reference in New Issue