looks like you were trying to achieve cache usage. But then you need to swap npm Install and copy all other files to image. Like this:
## this is the stage one , also know as the build stepFROM node:12.17.0-alpineWORKDIR /usr/src/appCOPY package*.json ./# these two swappedRUN npm installCOPY . .RUN npm run build
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why do you need to use the copy command twice in the first stage?
looks like you were trying to achieve cache usage. But then you need to swap npm Install and copy all other files to image. Like this: