-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (36 loc) · 791 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
50
51
# Builder
FROM node:18-alpine as builder
#
WORKDIR /usr/app
# dependencies
COPY package.json package-lock.json ./
# install dependencies
RUN npm ci
# build configuration
COPY tsconfig.json tsconfig.build.json nest-cli.json ./
# sources to build
COPY src ./src
COPY libs ./libs
# build sources
RUN npm run build
# remove devDependencies
RUN npm prune --omit=dev
# Runner
FROM node:18-alpine as runner
# timezone
RUN apk --no-cache add tzdata && \
cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime && \
echo "Asia/Seoul" > /etc/timezone && \
apk del tzdata
# for express
ENV NODE_ENV=production
#
WORKDIR /usr/app
#
COPY --from=builder /usr/app/node_modules ./node_modules
#
COPY --from=builder /usr/app/dist ./dist
#
CMD node dist/main
#
EXPOSE 3000/tcp