-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.dockerfile
More file actions
42 lines (30 loc) · 895 Bytes
/
dev.dockerfile
File metadata and controls
42 lines (30 loc) · 895 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
# Builder stage
FROM node:20-alpine as builder
ENV TZ=Asia/Seoul
RUN apk add --no-cache openssl
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN yarn global add dotenv-cli
RUN yarn prisma generate
RUN yarn build
# Runner stage
FROM node:20-alpine as runner
ENV TZ=Asia/Seoul
ENV PORT=3000
ENV NODE_ENV=dev
WORKDIR /usr/src/app
# OpenSSL 설치
RUN apk add --no-cache openssl
# 빌드 결과물 복사
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/package.json ./package.json
COPY --from=builder /usr/src/app/.dev.env ./.dev.env
# 포트 노출
EXPOSE 3000
# 헬스체크를 위한 startup probe 설정
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
CMD ["node", "dist/main.js"]