-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (20 loc) · 818 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
FROM node:16.1-buster-slim as builder
WORKDIR /usr/app
COPY . ./
RUN rm -rf /usr/app/node_modules
RUN apt-get update && apt-get install -y git
RUN yarn --pure-lockfile
RUN yarn build
RUN rm -rf /usr/app/node_modules
FROM node:16.1-buster-slim as runner
WORKDIR /usr/app
RUN apt-get update && apt-get install -y git
COPY --from=builder /usr/app/lib /usr/app/lib
COPY --from=builder /usr/app/build /usr/app/build
COPY --from=builder /usr/app/package.json /usr/app/package.json
COPY --from=builder /usr/app/tsconfig.json /usr/app/tsconfig.json
COPY --from=builder /usr/app/tsconfig.paths.json /usr/app/tsconfig.paths.json
COPY --from=builder /usr/app/tsconfig.build.json /usr/app/tsconfig.build.json
COPY --from=builder /usr/app/yarn.lock /usr/app/yarn.lock
RUN yarn install --production
CMD ["yarn", "start"]