-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
84 lines (56 loc) · 1.44 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# dependency install
FROM node:18-slim AS install
WORKDIR /app
COPY package*.json ./
RUN npm install
# # image create
FROM node:18-slim AS build
WORKDIR /app
COPY --chown=node:node --from=install /app/node_modules ./node_modules
COPY --chown=node:node . .
RUN npm run build
RUN npm ci --only=production --frozen-lockfile
FROM node:18-slim AS run
WORKDIR /app
COPY --chown=node:node --from=build /app/node_modules ./node_modules
COPY --chown=node:node --from=build /app/dist ./dist
ARG PROFILE
ENV NODE_ENV ${PROFILE}
ARG REDIS_HOST
ENV REDIS_HOST ${REDIS_HOST}
ARG REDIS_PORT
ENV REDIS_PORT ${REDIS_PORT}
ARG DB_HOST
ENV DB_HOST ${DB_HOST}
ARG DB_USERNAME
ENV DB_USERNAME ${DB_USERNAME}
ARG DB_PASSWORD
ENV DB_PASSWORD ${DB_PASSWORD}
ARG DB_NAME
ENV DB_NAME ${DB_NAME}
ARG DB_PORT
ENV DB_PORT ${DB_PORT}
ARG PORT
ENV PORT ${PORT}
ARG SECRET_KEY
ENV SECRET_KEY ${SECRET_KEY}
ARG AC_TOKEN_EXP
ENV AC_TOKEN_EXP ${AC_TOKEN_EXP}
ARG RF_TOKEN_EXP
ENV RF_TOKEN_EXP ${RF_TOKEN_EXP}
ARG OAUTH_GOOGLE_ID
ENV OAUTH_GOOGLE_ID ${OAUTH_GOOGLE_ID}
ARG KAKAO_CLIENT_ID
ENV KAKAO_CLIENT_ID ${KAKAO_CLIENT_ID}
ARG KAKAO_SECRET_KEY
ENV KAKAO_SECRET_KEY ${KAKAO_SECRET_KEY}
ARG KAKAO_REDIRECT_URI
ENV KAKAO_REDIRECT_URI ${KAKAO_REDIRECT_URI}
ARG AWS_S3_BUCKET_NAME
ENV AWS_S3_BUCKET_NAME ${AWS_S3_BUCKET_NAME}
ARG AWS_ACCESS_KEY
ENV AWS_ACCESS_KEY ${AWS_ACCESS_KEY}
ARG AWS_SECRET_KEY
ENV AWS_SECRET_KEY ${AWS_SECRET_KEY}
EXPOSE ${PORT}
CMD ["node", "dist/main.js"]