-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
38 lines (30 loc) · 944 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
# ---- Base image ----
FROM hmctspublic.azurecr.io/base/node:20-alpine as base
USER root
RUN corepack enable
USER hmcts
ENV WORKDIR /opt/app
WORKDIR ${WORKDIR}
COPY --chown=hmcts:hmcts package.json yarn.lock ./
RUN yarn config set httpProxy "$http_proxy" \
&& yarn config set httpsProxy "$https_proxy" \
&& yarn workspaces focus --all --production \
&& rm -rf $(yarn cache clean)
# ---- Build image ----
FROM base as build
COPY --chown=hmcts:hmcts . ./
USER root
RUN apk add git
USER hmcts
RUN PUPPETEER_SKIP_DOWNLOAD=true yarn install \
&& yarn setup-sass \
&& rm -rf /opt/app/.git
# ---- Runtime image ----
FROM build as runtime
#testing using build itself
#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" ]