forked from stolostron/console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.prow
More file actions
30 lines (26 loc) · 1.43 KB
/
Copy pathDockerfile.prow
File metadata and controls
30 lines (26 loc) · 1.43 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
# Copyright Contributors to the Open Cluster Management project
FROM registry.redhat.io/ubi9/nodejs-20-minimal@sha256:df3aa231f9e86f05ce8bd5b55a0ed391859313475ba41755b64c82156e498220 as dynamic-plugin
WORKDIR /app/frontend
COPY ./frontend .
RUN npm ci --legacy-peer-deps --ignore-scripts
RUN npm run build:plugin:acm
FROM registry.redhat.io/ubi9/nodejs-20-minimal@sha256:df3aa231f9e86f05ce8bd5b55a0ed391859313475ba41755b64c82156e498220 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 --ignore-scripts
COPY ./backend .
RUN npm run build
FROM registry.redhat.io/ubi9/nodejs-20-minimal@sha256:df3aa231f9e86f05ce8bd5b55a0ed391859313475ba41755b64c82156e498220 as production
WORKDIR /app/backend
COPY ./backend/package-lock.json ./backend/package.json ./
RUN npm ci --omit=optional --only=production --ignore-scripts
FROM registry.redhat.io/ubi9/nodejs-20-minimal@sha256:df3aa231f9e86f05ce8bd5b55a0ed391859313475ba41755b64c82156e498220
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/acm/dist ./public/plugin
USER 1001
CMD ["node", "backend.mjs"]