-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDockerfile-gateway
More file actions
58 lines (44 loc) · 1.62 KB
/
Copy pathDockerfile-gateway
File metadata and controls
58 lines (44 loc) · 1.62 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
55
56
57
58
# Regardless of arch being required (amd64 or arm64) this will
# 'compile' the hawtio-online javascript package natively without
# resorting to a foreign image that would have to be emulated and
# so really sloooow!
# The resulting javascript/assets are then copied into the final image
# that conforms with the correct architecture.
FROM --platform=${BUILDPLATFORM} docker.io/node:22-alpine as builder
WORKDIR /hawtio-online-gateway
COPY yarn.lock ./
COPY .yarnrc.yml ./
COPY .yarn/plugins .yarn/plugins
COPY .yarn/releases .yarn/releases
COPY packages/gateway/package.json ./
COPY packages/gateway/webpack.config.prod.js ./
COPY packages/gateway/tsconfig.json ./
COPY packages/gateway/src ./src/
COPY packages/gateway/public ./public/
RUN yarn install
RUN yarn build
#====================================================
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
#
# The user id
#
ENV NODE_USER 9999
ENV NODE_MAJOR_VERSION 22
ENV GATEWAY_DIR=/opt/hawtio-online-gateway
RUN microdnf -y module enable nodejs:22
RUN microdnf repoquery nodejs
RUN microdnf -y install --setopt=tsflags=nodocs nodejs && microdnf clean all
COPY --from=builder /hawtio-online-gateway/dist ${GATEWAY_DIR}/
COPY packages/gateway/env.product ${GATEWAY_DIR}/
COPY packages/gateway/gateway.sh ${GATEWAY_DIR}/
#
# Finalize permissions for gateway files
#
RUN useradd -ms /bin/sh -u ${NODE_USER} gateway
RUN chown -R ${NODE_USER} ${GATEWAY_DIR}
RUN chmod 755 ${GATEWAY_DIR}/gateway.sh
# Allow the environment to be updated by arbitrary image user
RUN chmod 666 ${GATEWAY_DIR}/env.product
USER ${NODE_USER}
EXPOSE 3000
CMD ["/opt/hawtio-online-gateway/gateway.sh"]