mirror of
https://github.com/Leado123/sharesyllabus-server.git
synced 2026-10-01 00:13:00 +00:00
update dockerfile
This commit is contained in:
+15
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user