From 91ba60446986b212e68588cee60b8abf05b3981b Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Wed, 26 Oct 2022 22:03:03 +0100 Subject: [PATCH] ples use cache thank --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index a287fe2..fcfb9b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,6 @@ 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 \ @@ -19,6 +13,11 @@ RUN \ else echo "Lockfile not found." && exit 1; \ fi +# Copy cached files +COPY node_modules ./ + +# Install dependencies +RUN yarn # Rebuild the source code only when needed FROM node:18-alpine AS builder