-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_devops
39 lines (32 loc) · 978 Bytes
/
Dockerfile_devops
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
## Docker Multi-stage(Build stage)
FROM node:20-alpine as build
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3 to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
# env
ARG BUILD_PROFILE
ARG IMAGE_TAG
ENV NODE_ENV production
# build prepare
WORKDIR /app
RUN corepack enable
RUN yarn set version stable
COPY . .
# build
RUN yarn
## Docker Multi-stage(Rumtime stage)
FROM node:20-alpine as runtime
ARG BUILD_PROFILE=wedapne2
ENV BUILD_PROFILE=$BUILD_PROFILE
ARG IMAGE_TAG
ENV IMAGE_TAG=$IMAGE_TAG
ENV NODE_ENV production
ENV UV_THREADPOOL_SIZE 16
WORKDIR /app
COPY --from=build /app/src /app/src
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/.yarn/releases /app/.yarn/releases
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/.yarnrc.yml /app/.yarnrc.yml
COPY --from=build /app/yarn.lock /app/yarn.lock
EXPOSE 4000
CMD ["yarn", "start"]