From f3bac9332b71b5cb8ce798cb463bbad11e7bbd0e Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Wed, 26 Oct 2022 21:50:06 +0100 Subject: [PATCH] Make use of cached files in build process --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e0a95b..a287fe2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,12 @@ FROM node:18-alpine AS deps RUN apk add libc6-compat WORKDIR /app +# Copy cached files +COPY ./node_modules ./node_modules + +# Install dependencies +RUN yarn + # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ RUN \ @@ -25,9 +31,6 @@ COPY . . # Uncomment the following line in case you want to disable telemetry during the build. ENV NEXT_TELEMETRY_DISABLED 1 -# Install dependencies -RUN yarn - # Build the project RUN yarn build