update dockerfile

This commit is contained in:
Leo Wen
2025-12-06 17:52:28 -08:00
parent ff8f19e3b7
commit 0e0866999c
+15 -1
View File
@@ -2,21 +2,35 @@
FROM oven/bun:1 AS base
WORKDIR /app
# Install system dependencies needed for native modules (argon2, etc.)
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies
FROM base AS install
WORKDIR /app
COPY package.json bun.lockb* ./
RUN bun install
# Copy source files and generate Prisma client
FROM base AS build
WORKDIR /app
COPY --from=install /app/node_modules ./node_modules
COPY . .
RUN bunx prisma generate
# Final production image
FROM base AS release
FROM oven/bun:1 AS release
WORKDIR /app
# Install runtime dependencies for native modules
RUN apt-get update && apt-get install -y \
openssl \
&& rm -rf /var/lib/apt/lists/*
# Copy necessary files from build stage
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/src ./src