From b51cb95af5b411920e2470eabcd01dffcbd33e62 Mon Sep 17 00:00:00 2001 From: danthe42 Date: Thu, 6 Nov 2025 21:52:53 +0100 Subject: [PATCH] 16 --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index daa4092..3f14bff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,13 +14,14 @@ ENV NODE_ENV production WORKDIR /usr/src/app +COPY package.json . +COPY package-lock.json . + # Download dependencies as a separate step to take advantage of Docker's caching. # Leverage a cache mount to /root/.npm to speed up subsequent builds. # Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into # into this layer. -RUN --mount=type=bind,source=package.json,target=package.json \ - --mount=type=bind,source=package-lock.json,target=package-lock.json \ - --mount=type=cache,target=/root/.npm \ +RUN --mount=type=cache,target=/root/.npm \ npm ci --omit=dev # Run the application as a non-root user.