Copy the lockfile before the source in a Dockerfile
Every layer after a changed file is rebuilt. If COPY . . comes before pnpm install, a one line code change reinstalls everything.
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .The install layer is cached until a dependency changes, which is a few times a month rather than a few times an hour.
dockerci