-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile-gateway
52 lines (38 loc) · 1.24 KB
/
Dockerfile-gateway
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
FROM node:20-alpine as builder
WORKDIR /hawtio-online-gateway
COPY yarn.lock ./
COPY .yarnrc.yml ./
COPY .yarn/plugins .yarn/plugins
COPY .yarn/releases .yarn/releases
COPY docker/gateway/package.json ./
COPY docker/gateway/webpack.config.prod.js ./
COPY docker/gateway/tsconfig.json ./
COPY docker/gateway/src ./src/
COPY docker/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 20
ENV GATEWAY_DIR=/opt/hawtio-online-gateway
RUN microdnf -y module enable nodejs:20
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 docker/gateway/env.product ${GATEWAY_DIR}/
COPY docker/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"]