From 007d5375ef21b924dd0960f02a4876c144aa9a01 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 19 May 2026 20:31:14 +0000 Subject: [PATCH] chore: update Dockerfile to use builder stage --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index e8eca32..6a59d98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,10 @@ RUN \ COPY package.json bun.lockb ./ RUN bun install --frozen-lockfile +FROM base AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules + # Copy the rest of the app source and build it COPY . . RUN bun run build @@ -32,6 +36,11 @@ RUN bun run build FROM node:20-alpine as runner WORKDIR /app +ENV NODE_ENV production + +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + # Only copy what's necessary for production from the builder stage COPY --from=base /app/.next ./.next COPY --from=base /app/node_modules ./node_modules