Why copy the manifest first?
COPY package.json . RUN npm ci COPY . .
- The install layer caches
- The image ends up smaller
- The build runs in parallel
- The context uploads faster
Source edits then invalidate only the last layer, so dependencies are not reinstalled.
Play DevOps ▸