-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathDockerfile.art
More file actions
54 lines (40 loc) · 1.79 KB
/
Dockerfile.art
File metadata and controls
54 lines (40 loc) · 1.79 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
49
50
51
52
53
54
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.17 AS web-builder
# Copy app sources
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
COPY . /usr/src/app
WORKDIR /usr/src/app
# bootstrap yarn so we can install and run the other tools.
USER 0
ARG YARN_VERSION=v1.22.19
RUN CACHED_YARN=./artifacts/yarn-${YARN_VERSION}.tar.gz; \
if [ -f ${CACHED_YARN} ]; then \
npm install -g ${CACHED_YARN}; \
else \
echo "need yarn at ${CACHED_YARN}"; \
exit 1; \
fi
# use dependencies provided by Cachito
ENV HUSKY=0
ENV CYPRESS_INSTALL_BINARY=0
RUN make install-frontend-ci && make build-frontend
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS go-builder
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
ENV GOEXPERIMENT=strictfipsruntime
ENV CGO_ENABLED=1
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env \
&& make build-backend BUILD_OPTS="-tags strictfipsruntime"
FROM registry.ci.openshift.org/ocp/4.17:base-rhel9
RUN INSTALL_PKGS="nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*' && \
chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run
USER 1001
COPY --from=web-builder /usr/src/app/web/dist /usr/share/nginx/html
COPY --from=web-builder /usr/src/app/web/dist /opt/app-root/web/dist
COPY --from=go-builder $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/plugin-backend /opt/app-root
ENTRYPOINT ["nginx", "-g", "daemon off;"]
# When nginx is removed from CMO, we can use the following ENTRYPOINT instead and remove the nginx install
# ENTRYPOINT ["/opt/app-root/plugin-backend", "-static-path", "/opt/app-root/web/dist"]