forked from opendatahub-io/odh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Dockerfile.konflux
61 lines (43 loc) · 2.29 KB
/
Dockerfile.konflux
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
49
50
51
52
53
54
55
56
57
58
59
60
61
# Build arguments
ARG SOURCE_CODE=.
FROM registry.access.redhat.com/ubi8/nodejs-18@sha256:2fcda2fccd4c4c969ad81d707aab18d5ff2894cc0e47ccb2361e1510f3e8a269 as builder
## Build args to be used at this step
ARG SOURCE_CODE
WORKDIR /usr/src/app
## Copying in source code
COPY --chown=default:root ${SOURCE_CODE} /usr/src/app
# Change file ownership to the assemble user
USER default
RUN npm cache clean --force
RUN npm ci --omit=optional
# Set Red Hat Openshift AI logo and links
ENV ODH_LOGO=../images/rhoai-logo.svg
ENV ODH_PRODUCT_NAME="Red Hat OpenShift AI"
ENV ODH_FAVICON="rhoai-favicon.svg"
ENV DOC_LINK="https://docs.redhat.com/en/documentation/red_hat_openshift_ai/"
ENV SUPPORT_LINK="https://access.redhat.com/support/cases/#/case/new/open-case?caseCreate=true"
ENV COMMUNITY_LINK=""
RUN npm run build
FROM registry.access.redhat.com/ubi8/nodejs-18@sha256:2fcda2fccd4c4c969ad81d707aab18d5ff2894cc0e47ccb2361e1510f3e8a269 as runtime
WORKDIR /usr/src/app
RUN mkdir /usr/src/app/logs && chmod 775 /usr/src/app/logs
USER 1001:0
COPY --chown=default:root --from=builder /usr/src/app/frontend/public /usr/src/app/frontend/public
COPY --chown=default:root --from=builder /usr/src/app/backend/package.json /usr/src/app/backend/package.json
COPY --chown=default:root --from=builder /usr/src/app/backend/package-lock.json /usr/src/app/backend/package-lock.json
COPY --chown=default:root --from=builder /usr/src/app/backend/dist /usr/src/app/backend/dist
COPY --chown=default:root --from=builder /usr/src/app/.npmrc /usr/src/app/backend/.npmrc
COPY --chown=default:root --from=builder /usr/src/app/.env /usr/src/app/.env
COPY --chown=default:root --from=builder /usr/src/app/data /usr/src/app/data
RUN cd backend && npm cache clean --force && npm ci --omit=dev --omit=optional && chmod -R g+w ${HOME}/.npm
WORKDIR /usr/src/app/backend
CMD ["npm", "run", "start"]
LABEL com.redhat.component="odh-dashboard-container" \
name="managed-open-data-hub/odh-dashboard-rhel8" \
description="odh-dashboard" \
summary="odh-dashboard" \
maintainer="['[email protected]']" \
io.openshift.expose-services="" \
io.k8s.display-name="odh-dashboard" \
io.k8s.description="odh-dashboard" \
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"