-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 764 Bytes
/
Dockerfile
File metadata and controls
35 lines (23 loc) · 764 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
# ----- Build Stage ----
FROM node:22 AS builder
WORKDIR /app
COPY package*.json ./
COPY ./prisma ./prisma
RUN npm install
RUN npx prisma generate
COPY . .
RUN npm run build
RUN ls /app
# ------ Production Stage ------
FROM node:22-slim AS prod
WORKDIR /app
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/generated/prisma ./generated
RUN apt-get update -y && apt-get install -y openssl
RUN npm install --production
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/health', res => { if(res.statusCode !== 200) process.exit(1) })"
EXPOSE 3000
CMD [ "node", "dist/app.js" ]