-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (24 loc) · 825 Bytes
/
Dockerfile
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
ARG BUN_VERSION=1.1.38
ARG APP_NAME=backend
ARG YARN_PKG_MANAGER="this.packageManager=\"[email protected]\""
ARG BUN_PKG_MANAGER="this.packageManager=\"bun@${BUN_VERSION}\""
FROM imbios/bun-node:${BUN_VERSION}-22-slim AS base
WORKDIR /app
FROM base AS pruner
ARG YARN_PKG_MANAGER
ARG APP_NAME
COPY . .
RUN bunx json -I -f package.json -e ${YARN_PKG_MANAGER}
RUN bunx turbo prune ${APP_NAME} --docker
FROM base AS builder
ARG BUN_PKG_MANAGER
ARG APP_NAME
COPY --from=pruner ./app/out/json/ .
RUN bun install
COPY --from=pruner ./app/out/full/ .
RUN bunx json -I -f package.json -e ${BUN_PKG_MANAGER}
RUN bun turbo run build
FROM base AS release
ARG APP_NAME
COPY --from=builder ./app .
ENTRYPOINT ["sh", "-c", "bunx prisma generate --schema ./apps/backend/prisma/schema.prisma && bun ./apps/backend/dist/server/index.js"]