-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
39 lines (25 loc) · 914 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
FROM node:14.18.1-alpine3.13 as building
# needed for git dependencies
RUN apk update && apk upgrade && \
apk add --no-cache bash=5.1.16-r0 git=2.30.6-r0 openssh=8.4_p1-r4 python3=3.8.15-r0 make=4.3-r0 g++=10.2.1_pre1-r3
RUN mkdir /council
WORKDIR /council
# we need specific npm version for git dependencies
RUN npm i -g [email protected]
COPY ./package*.json ./
COPY ./yarn*.lock ./
COPY ./tsconfig*.json ./
COPY ./src ./src
RUN yarn install --frozen-lockfile --non-interactive && yarn cache clean
RUN yarn typechain && yarn build
FROM node:14.18.1-alpine3.13
ENV PORT=
RUN mkdir /council
WORKDIR /council
COPY --from=building /council/dist ./dist
COPY --from=building /council/node_modules ./node_modules
COPY ./package*.json ./
USER node
HEALTHCHECK --interval=120s --timeout=10s --retries=2 \
CMD sh -c "wget -nv -t1 --spider http://localhost:$PORT/health" || exit 1
CMD ["yarn", "start:prod"]