-
Notifications
You must be signed in to change notification settings - Fork 34
/
Dockerfile
38 lines (27 loc) · 959 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
# build env
FROM node:16-alpine as build
WORKDIR /app
RUN apk add --no-cache git=2.36.3-r0
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --non-interactive --ignore-scripts && yarn cache clean
COPY . .
RUN NODE_NO_BUILD_DYNAMICS=true yarn typechain && yarn build
# public/runtime is used to inject runtime vars; it should exist and user node should have write access there for it
RUN rm -rf /app/public/runtime && mkdir /app/public/runtime && chown node /app/public/runtime
# final image
FROM node:16-alpine as base
ARG BASE_PATH=""
ARG SUPPORTED_CHAINS="1"
ARG DEFAULT_CHAIN="1"
ENV NEXT_TELEMETRY_DISABLED=1 \
BASE_PATH=$BASE_PATH \
SUPPORTED_CHAINS=$SUPPORTED_CHAINS \
DEFAULT_CHAIN=$DEFAULT_CHAIN
WORKDIR /app
RUN apk add --no-cache curl=7.83.1-r4
COPY --from=build /app /app
USER node
EXPOSE 3000
HEALTHCHECK --interval=10s --timeout=3s \
CMD curl -f http://localhost:3000/api/health || exit 1
CMD ["yarn", "start"]