-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile.prow
40 lines (33 loc) · 2.24 KB
/
Dockerfile.prow
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
FROM registry.ci.openshift.org/stolostron/builder:nodejs14-linux as builder
# Root needed for yum update, gets reset to 1001 below.
USER root
WORKDIR /opt/app-root/src/application-ui
COPY . /opt/app-root/src/application-ui/
RUN yum --nobest -y update
RUN cd /opt/app-root/src/application-ui/ && npm ci && npm run build:production && npm prune --production
FROM registry.ci.openshift.org/stolostron/common-nodejs-parent:nodejs-14
RUN microdnf update
ENV BABEL_DISABLE_CACHE=1 \
NODE_ENV=production \
USER_UID=1001
RUN mkdir -p /opt/app-root/src/application-ui
WORKDIR /opt/app-root/src/application-ui
COPY --from=builder /opt/app-root/src/application-ui/.babelrc /opt/app-root/src/application-ui/.babelrc
COPY --from=builder /opt/app-root/src/application-ui/LICENSE /opt/app-root/src/application-ui/LICENSE
COPY --from=builder /opt/app-root/src/application-ui/app.js /opt/app-root/src/application-ui/app.js
COPY --from=builder /opt/app-root/src/application-ui/config /opt/app-root/src/application-ui/config
COPY --from=builder /opt/app-root/src/application-ui/controllers /opt/app-root/src/application-ui/controllers
COPY --from=builder /opt/app-root/src/application-ui/dll /opt/app-root/src/application-ui/dll
COPY --from=builder /opt/app-root/src/application-ui/fonts /opt/app-root/src/application-ui/fonts
COPY --from=builder /opt/app-root/src/application-ui/graphics /opt/app-root/src/application-ui/graphics
COPY --from=builder /opt/app-root/src/application-ui/lib /opt/app-root/src/application-ui/lib
COPY --from=builder /opt/app-root/src/application-ui/middleware /opt/app-root/src/application-ui/middleware
COPY --from=builder /opt/app-root/src/application-ui/nls /opt/app-root/src/application-ui/nls
COPY --from=builder /opt/app-root/src/application-ui/node_modules /opt/app-root/src/application-ui/node_modules
COPY --from=builder /opt/app-root/src/application-ui/public /opt/app-root/src/application-ui/public
COPY --from=builder /opt/app-root/src/application-ui/src-web /opt/app-root/src/application-ui/src-web
COPY --from=builder /opt/app-root/src/application-ui/templates /opt/app-root/src/application-ui/templates
COPY --from=builder /opt/app-root/src/application-ui/views /opt/app-root/src/application-ui/views
EXPOSE 3000
USER ${USER_UID}
CMD ["node", "app.js"]