forked from mitre/heimdall2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.lite
39 lines (26 loc) · 1.38 KB
/
Dockerfile.lite
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
38
39
ARG BUILD_CONTAINER=registry.access.redhat.com/ubi8/nodejs-18-minimal:1
ARG BASE_CONTAINER=nginx:alpine
FROM $BUILD_CONTAINER AS builder
ARG NODE_ENV=production
ENV NODE_ENV=$NODE_ENV
ARG YARNREPO_MIRROR=https://registry.npmjs.org
ENV YARNREPO=$YARNREPO_MIRROR
USER 0
WORKDIR /src
# python3/make/compiler is a requirement for node-gyp
RUN curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo && microdnf install -y python3 make gcc-c++ yarn && microdnf clean all && rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*
COPY package.json yarn.lock lerna.json tsconfig.json postcss.config.js ./
COPY apps/frontend/package.json apps/frontend/tsconfig.json ./apps/frontend/
COPY libs/hdf-converters/package.json libs/hdf-converters/tsconfig.* ./libs/hdf-converters/
COPY libs/inspecjs/package.json libs/inspecjs/tsconfig.* ./libs/inspecjs/
COPY libs/interfaces/package.json libs/interfaces/tsconfig.json ./libs/interfaces/
COPY libs/password-complexity/package.json ./libs/password-complexity/
RUN sed -i s^https://registry.yarnpkg.com^$YARNREPO^g yarn.lock
RUN yarn install --frozen-lockfile --production --network-timeout 600000
COPY apps/frontend ./apps/frontend
COPY libs ./libs
RUN yarn frontend build
FROM $BASE_CONTAINER AS production-stage
EXPOSE 80
COPY --from=builder /src/dist/frontend /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]