forked from stateofca/opencred
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (24 loc) · 774 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
# Copyright 2023 - 2024 California Department of Motor Vehicles
# Copyright 2023 - 2024 Digital Bazaar, Inc.
#
# SPDX-License-Identifier: BSD-3-Clause
FROM node:20-alpine AS base
RUN mkdir -p /home/node/app && chown -R node:node /home/node/app
WORKDIR /home/node/app
FROM base AS build-setup
RUN apk add --no-cache git bash
FROM build-setup AS build
ARG NODE_AUTH_TOKEN
USER node
COPY --chown=node:node . .
RUN mv dev.js index.js
RUN npm i --omit=dev --package-lock
RUN node index.js bundle --webpack-mode production --bundle-mode production
FROM build AS test
# RUN cd test && npm t
# RUN rm -rf test#
FROM base AS release
COPY --from=test --chown=node:node /home/node/app ./
EXPOSE 22443
ENV NODE_ENV=production
CMD [ "node", "index", "--bundle-mode", "production"]