-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (31 loc) · 859 Bytes
/
Dockerfile
File metadata and controls
46 lines (31 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# --- Dockerfile ---
FROM oven/bun:alpine AS build
# Install build dependencies
RUN apk add --no-cache openssl
WORKDIR /app
COPY package.json bun.lock ./
COPY prisma ./prisma
# Install dependencies and generate Prisma Client
RUN bun install
RUN bunx prisma generate
COPY src ./src
ENV NODE_ENV=production
RUN bun build \
--compile \
--minify-whitespace \
--minify-syntax \
--target bun \
--outfile server \
./src/index.ts
# ---------------------------
# Final Image for musl (Alpine)
# ---------------------------
FROM oven/bun:alpine AS final
RUN apk add --no-cache openssl libstdc++ libgcc
WORKDIR /app
COPY --from=build /app/server .
COPY --from=build /app/generated ./generated
ENV PRISMA_QUERY_ENGINE_LIBRARY=/app/generated/query-engine-linux-musl-openssl-3.0.x
ENV NODE_ENV=production
CMD ["./server"]
EXPOSE 4000