From 982c84cc33267fd69144b793cdac3c3a5eac0c4b Mon Sep 17 00:00:00 2001 From: Shaun Campbell Date: Fri, 20 Feb 2026 22:55:21 -0500 Subject: [PATCH] docker) build app with node instead of bun --- Dockerfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2e18153..bb4fe4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # ── Build stage ──────────────────────────────────────────────────────────────── -FROM oven/bun:1 AS builder +FROM node:22-bookworm-slim AS builder WORKDIR /app @@ -9,27 +9,25 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # Copy dependency manifests first for better layer caching -COPY package.json bun.lock ./ +COPY package.json ./ # Install all deps (including devDependencies needed for the build). -# better-sqlite3 is a native module — it must be compiled here on Linux, -# not copied from a macOS node_modules. -RUN bun install --frozen-lockfile +RUN npm install # Copy source and build COPY . . -RUN bun run build +RUN npm run build # Prune to production-only deps, recompiling native modules for Linux -RUN bun install --frozen-lockfile --production +RUN npm prune --omit=dev # ── Runtime stage ─────────────────────────────────────────────────────────────── -FROM node:22-alpine AS runtime +FROM node:22-bookworm-slim AS runtime WORKDIR /app # Create a non-root user to run the app -RUN addgroup -S trips && adduser -S trips -G trips +RUN groupadd --system trips && useradd --system --gid trips trips # Copy the built app and production node_modules from the builder COPY --from=builder /app/build ./build