chore: update Dockerfile to use builder stage

This commit is contained in:
Jason Fraley 2026-05-19 20:31:14 +00:00
parent e3722f495e
commit 007d5375ef

View file

@ -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