-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 740 Bytes
/
Copy pathDockerfile
File metadata and controls
41 lines (29 loc) · 740 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
FROM node:16-alpine as build
ARG NPM_TOKEN
WORKDIR /target
COPY ./ ./
RUN apk add --no-cache python3 make g++
RUN echo $NPM_TOKEN > .npmrc && \
yarn install && \
yarn build && \
rm -rf build/node_modules && \
rm -f .npmrc
FROM node:16-alpine
RUN apk add --no-cache dumb-init python3 make g++
ARG NPM_TOKEN
ARG build_SEM_VER
ARG build_BUILD_NUM
ARG build_GIT_SHA
ARG build_BUILD_URL
ENV SEM_VER=${build_SEM_VER}
ENV BUILD_NUM=${build_BUILD_NUM}
ENV GIT_SHA=${build_GIT_SHA}
ENV BUILD_URL=${build_BUILD_URL}
WORKDIR /usr/src/app
COPY --from=build /target/build ./
RUN echo $NPM_TOKEN > .npmrc && \
yarn install --production && \
rm -f .npmrc && \
yarn cache clean
ENTRYPOINT [ "dumb-init" ]
CMD ["node", "start.js"]