-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 855 Bytes
/
Dockerfile
File metadata and controls
30 lines (24 loc) · 855 Bytes
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
# ---- Base image ----
FROM hmctsprod.azurecr.io/base/node:24-alpine as base
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
USER root
RUN corepack enable
USER hmcts
COPY --chown=hmcts:hmcts .yarn ./.yarn
COPY --chown=hmcts:hmcts config ./config
COPY --chown=hmcts:hmcts package.json yarn.lock .yarnrc.yml tsconfig.json ./
RUN yarn workspaces focus --all --production && yarn cache clean
# ---- Build image ----
FROM base as build
COPY --chown=hmcts:hmcts . ./
RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn install --immutable
COPY tsconfig.json gulpfile.js server.js ./
COPY --chown=hmcts:hmcts src/main ./src/main
RUN yarn setup
# ---- Runtime image ----
FROM base as runtime
COPY --from=build $WORKDIR/src/main ./src/main
COPY --from=build $WORKDIR/server.js $WORKDIR/tsconfig.json ./
COPY config ./config
EXPOSE 3000