-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathContainerfile.mce
More file actions
48 lines (42 loc) · 1.81 KB
/
Copy pathContainerfile.mce
File metadata and controls
48 lines (42 loc) · 1.81 KB
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
40
41
42
43
44
45
46
47
48
# Copyright Contributors to the Open Cluster Management project
ARG NODE_BASE=registry.redhat.io/ubi9/nodejs-24-minimal:latest
FROM ${NODE_BASE} as build-base
USER root
ENV NPM_CONFIG_IGNORE_SCRIPTS=true
FROM build-base as dynamic-plugin
WORKDIR /app/frontend
COPY ./frontend .
# Optimization of copying only package.json and package-lock.json does not work because of workspace packages
RUN npm ci --legacy-peer-deps
RUN npm run build:plugin:mce
FROM build-base as backend
WORKDIR /app/backend
# Copy only package.json and package-lock.json so that the docker layer cache only changes if those change
# This will cause the npm ci to only rerun if the package.json or package-lock.json changes
COPY ./backend/package.json ./backend/package-lock.json ./
RUN npm ci --omit=optional
COPY ./backend .
RUN npm run build
FROM build-base as production
WORKDIR /app/backend
COPY ./backend/package-lock.json ./backend/package.json ./
RUN npm ci --omit=optional --only=production
FROM ${NODE_BASE}
WORKDIR /app
ENV NODE_ENV production
COPY --from=production /app/backend/node_modules ./node_modules
COPY --from=backend /app/backend/backend.mjs ./
COPY --from=dynamic-plugin /app/frontend/plugins/mce/dist ./public/plugin
USER 1001
CMD ["node", "backend.mjs"]
LABEL com.redhat.component="multicluster-engine-console-mce-container" \
cpe="cpe:/a:redhat:multicluster_engine:5.0::el9" \
url="https://github.com/stolostron/console" \
name="multicluster-engine/console-mce-rhel9" \
summary="multicluster-engine-console-mce" \
io.openshift.expose-services="" \
io.openshift.tags="data,images" \
io.k8s.display-name="multicluster-engine-console-mce" \
maintainer="['acm-component-maintainers@redhat.com']" \
description="multicluster-engine-console-mce" \
io.k8s.description="multicluster-engine-console-mce"