forked from openshift-assisted/assisted-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 879 Bytes
/
Dockerfile
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
FROM registry.access.redhat.com/ubi8/nodejs-14 as builder
ENV NODE_OPTIONS="--max-old-space-size=8192"
ARG REACT_APP_BUILD_MODE
ENV REACT_APP_BUILD_MODE=$REACT_APP_BUILD_MODE
ARG REACT_APP_GIT_SHA
ENV REACT_APP_GIT_SHA=$REACT_APP_GIT_SHA
ARG REACT_APP_VERSION
ENV REACT_APP_VERSION=$REACT_APP_VERSION
COPY --chown=1001:0 / /src/
RUN chmod 775 /src/
WORKDIR /src/
RUN npx yarn install
RUN npx yarn lint
RUN npx yarn build
FROM registry.access.redhat.com/ubi8/nginx-120 as app
# persist these on the final image for later inspection
ARG REACT_APP_GIT_SHA
ENV GIT_SHA=$REACT_APP_GIT_SHA
ARG REACT_APP_VERSION
ENV VERSION=$REACT_APP_VERSION
COPY deploy/deploy_config.sh /deploy/
COPY deploy/ui-deployment-template.yaml /deploy/
COPY deploy/nginx.conf /deploy/
COPY deploy/start.sh /deploy/
COPY --from=builder /src/build/ "${NGINX_APP_ROOT}/src/"
CMD [ "/deploy/start.sh" ]