-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
36 lines (26 loc) · 1.01 KB
/
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
ARG PLATFORM=""
FROM hmctspublic.azurecr.io/base/node${PLATFORM}:18-alpine as base
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV NODE_OPTIONS=--openssl-legacy-provider
USER root
RUN apk update \
&& apk add bzip2 patch python3 py3-pip make gcc g++ \
&& rm -rf /var/lib/apt/lists/* \
&& export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
COPY --chown=hmcts:hmcts package.json yarn.lock ./
USER hmcts
COPY app.js server.js ./
COPY app ./app
COPY config ./config
RUN yarn config set yarn-offline-mirror ~/npm-packages-offline-cache && \
yarn config set yarn-offline-mirror-pruning true && \
yarn install --prefer-offline --ignore-optional --network-timeout 1200000
# ---- Build Image ----
FROM base as build
RUN sleep 1 && yarn install --ignore-optional --production --network-timeout 1200000 && yarn cache clean
# Runtime image
FROM hmctspublic.azurecr.io/base/node${PLATFORM}:18-alpine as runtime
COPY --from=build $WORKDIR .
ENV PORT 3453
EXPOSE 3453