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.
+2 -3
View File
@@ -3,7 +3,7 @@
"module": "index.ts",
"type": "module",
"engines": {
"node": ">=20.0.0 <21.0.0"
"node": ">=20.0.0 <21.0.0"
},
"devDependencies": {
"@types/bun": "latest",
@@ -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",