Make use of cached files in build process

This commit is contained in:
Liam 2022-10-26 21:50:06 +01:00
parent 7d3ffe7865
commit f3bac9332b

@ -4,6 +4,12 @@ FROM node:18-alpine AS deps
RUN apk add libc6-compat RUN apk add libc6-compat
WORKDIR /app WORKDIR /app
# Copy cached files
COPY ./node_modules ./node_modules
# Install dependencies
RUN yarn
# Install dependencies based on the preferred package manager # Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN \ RUN \
@ -25,9 +31,6 @@ COPY . .
# Uncomment the following line in case you want to disable telemetry during the build. # Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
# Install dependencies
RUN yarn
# Build the project # Build the project
RUN yarn build RUN yarn build