From 74d49935be04a126f36afd7e45ed36dd3834ffb4 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sat, 14 Mar 2026 18:00:30 -0700 Subject: [PATCH] Refactor: Switch Docker base image to Bun --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9aaa22b..3eae039 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ -FROM node:18-alpine AS base +FROM oven/bun:alpine AS base # Install dependencies only when needed FROM base AS deps -RUN apk add --no-cache libc6-compat WORKDIR /app +# Copy package files (Bun can install from package.json just fine) COPY package.json package-lock.json* ./ -RUN npm install +RUN bun install # Rebuild the source code only when needed FROM base AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -RUN npm run build +RUN bun run build # Production image, copy all the files and run next FROM base AS runner @@ -25,6 +25,7 @@ RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs COPY --from=builder /app/public ./public +# Next.js standalone output works perfectly via Bun COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static @@ -32,4 +33,5 @@ USER nextjs EXPOSE 3004 -CMD ["node", "server.js"] +# Run the Next.js standalone server using Bun instead of Node +CMD ["bun", "server.js"]