-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (29 loc) · 891 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
FROM node:22-bullseye as deps
# RUN apt-get update && apt-get install
WORKDIR /app
COPY package.json ./
COPY prisma/ ./prisma/
RUN npm install
FROM node:22-bullseye as builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/package.json ./package.json
COPY --from=deps /app/prisma/ ./prisma/
COPY tsconfig.json ./tsconfig.json
COPY src/ ./src/
COPY templates/ ./templates/
COPY static/ ./static
RUN npm install -g typescript
RUN npx prisma generate
RUN tsc
FROM node:22-bullseye as runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/prisma/ ./prisma/
COPY --from=builder /app/templates/ ./templates/
COPY --from=builder /app/static/ ./static/
EXPOSE 4000
CMD ["npm", "run", "start"]