-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (31 loc) · 936 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM oven/bun:1-alpine AS build
WORKDIR /app
# Cache packages installation
COPY package.json package.json
COPY bun.lockb bun.lockb
COPY prisma/schema.prisma prisma/schema.prisma
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
FROM node:23-bullseye AS prod
WORKDIR /app
COPY --from=build /app/server /app/server
COPY --from=build /app/node_modules/.prisma/client /app/node_modules/.prisma/client
COPY --from=build /app/prisma/schema.prisma /app/prisma/schema.prisma
RUN npm install prisma --save-dev
CMD ["/app/server"]
EXPOSE 3000
# FROM debian:bullseye AS prod
# WORKDIR /app
# COPY --from=build /app/server /app/server
# COPY --from=build /app/node_modules/.prisma/client /app/node_modules/.prisma/client
# CMD ["/app/server"]
# EXPOSE 3000