From 64da241a7649e51c02adad064bbeb4a264793089 Mon Sep 17 00:00:00 2001 From: Isaac Date: Wed, 15 Feb 2023 01:22:09 +0000 Subject: [PATCH] perf(docker): reorder commands to improve caching (maybe?) --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ffec55a..b2aec35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,12 @@ FROM node:18-alpine AS builder WORKDIR /build -COPY package.json pnpm-lock.yaml ./ -COPY --link scripts scripts # install python etc so node-gyp works for the optional dependencies RUN apk add --no-cache make gcc g++ python3 # install pnpm to make dependency installation faster (because it has a lockfile) RUN npm install -g pnpm +COPY package.json pnpm-lock.yaml ./ +COPY --link scripts scripts # install dependencies, CI=true to skip pre/postinstall scripts RUN CI=true pnpm install --prod --frozen-lockfile COPY --link . .