forked from hmcts/probate-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (25 loc) · 834 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
# ---- Base image ----
FROM hmctspublic.azurecr.io/base/node:14-alpine as base
ENV WORKDIR /opt/app
WORKDIR ${WORKDIR}
COPY --chown=hmcts:hmcts package.json yarn.lock ./
RUN yarn config set proxy "$http_proxy" && yarn config set https-proxy "$https_proxy"
RUN yarn install --production \
&& yarn cache clean
# ---- Build image ----
FROM base as build
COPY --chown=hmcts:hmcts . ./
USER root
RUN apk add git
USER hmcts
RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn install \
&& yarn setup \
&& rm -rf /opt/app/.git
# ---- Runtime image ----
FROM base as runtime
COPY --from=build ${WORKDIR}/app app/
COPY --from=build ${WORKDIR}/config config/
COPY --from=build ${WORKDIR}/public public/
COPY --from=build ${WORKDIR}/server.js ${WORKDIR}/app.js ${WORKDIR}/git.properties.json ./
EXPOSE 3000
CMD ["yarn", "start" ]