This commit is contained in:
Leo Wen
2025-12-06 18:25:05 -08:00
parent 0e0866999c
commit f595e62e18
3 changed files with 20 additions and 13 deletions
+18 -10
View File
@@ -1,34 +1,42 @@
# Use official Bun image
FROM oven/bun:1 AS base
# Use official Bun image with Debian for native module support
FROM oven/bun:1.1.38-debian AS base
WORKDIR /app
# Install system dependencies needed for native modules (argon2, etc.)
# Install dependencies stage with build tools for native modules
FROM base AS install
WORKDIR /app
# Install build dependencies 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 files
COPY package.json bun.lockb* ./
# Install all dependencies including native ones
RUN bun install
# Copy source files and generate Prisma client
# Generate Prisma client (needs the schema)
COPY prisma ./prisma
RUN bunx prisma generate
# Build stage - copy source files
FROM base AS build
WORKDIR /app
COPY --from=install /app/node_modules ./node_modules
COPY . .
RUN bunx prisma generate
# Final production image
FROM oven/bun:1 AS release
FROM oven/bun:1.1.38-debian AS release
WORKDIR /app
# Install runtime dependencies for native modules
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
openssl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy necessary files from build stage
BIN
View File
Binary file not shown.
+1 -2
View File
@@ -33,8 +33,7 @@
"jsonwebtoken": "^9.0.2",
"jwt": "^0.2.0",
"pg": "^8.13.1",
"prisma": "^6.3.1",
"spamscanner": "^5.1.5"
"prisma": "^6.3.1"
},
"scripts": {
"start": "bun src/index.ts",