Hopefully make Dockerfile use cache?

This commit is contained in:
Liam 2022-10-29 15:58:00 +01:00
parent f1c03442b8
commit ae621cae3f

@ -4,9 +4,6 @@ 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 /app
# # 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 \
@ -50,6 +47,9 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static
# Copy cached files
COPY node_modules ./
RUN npm i RUN npm i
RUN chown -R nextjs:nodejs /app RUN chown -R nextjs:nodejs /app