-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile-plugin
109 lines (80 loc) · 2.8 KB
/
Dockerfile-plugin
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
FROM docker.io/node:20-alpine as builder
#
# The plugin name
#
ENV PLUGIN_NAME hawtio-online-console-plugin
ENV PACKAGE_PLUGIN packages/plugin
WORKDIR /${PLUGIN_NAME}
COPY .yarn/plugins .yarn/plugins
COPY .yarn/releases .yarn/releases
COPY .yarnrc.yml ./
COPY Makefile Makefile
COPY yarn.lock yarn.lock
COPY ${PACKAGE_PLUGIN}/public public
COPY ${PACKAGE_PLUGIN}/src src
COPY ${PACKAGE_PLUGIN}/console-extensions.json console-extensions.json
COPY ${PACKAGE_PLUGIN}/package.json package.json
COPY ${PACKAGE_PLUGIN}/tsconfig.json tsconfig.json
COPY ${PACKAGE_PLUGIN}/webpack.config.common.js webpack.config.common.js
COPY ${PACKAGE_PLUGIN}/webpack.config.prod.js webpack.config.prod.js
RUN command -v yarn || npm i -g yarn
USER root
## Install dependencies
RUN yarn install
## Build application
RUN yarn build
### END BUILD STAGE ###
### INSTALL envsubst STAGE ###
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4 as envsubst
RUN microdnf -y install gettext
### END INSTALL envsubst STAGE ###
### CONFIGURE STAGE ###
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
#
# Version of nginx
#
ENV NGINX_MAJOR_VERSION 1
ENV NGINX_MINOR_VERSION 22
ENV NGINX_BUILD_VERSION 1
#
# Install nginx and cleanup
#
RUN microdnf -y module enable nginx:${NGINX_MAJOR_VERSION}.${NGINX_MINOR_VERSION}
RUN microdnf install -y nginx-${NGINX_MAJOR_VERSION}.${NGINX_MINOR_VERSION}.${NGINX_BUILD_VERSION} && \
microdnf clean all
#
# The plugin name
#
ENV PLUGIN_NAME hawtio-online-console-plugin
ENV PACKAGE_PLUGIN packages/plugin
USER root
# forward request and error logs to docker log collector
# - Change pid file location & remove nginx user & change port to 8080
# - modify perms for non-root runtime
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log && \
rm -f /etc/nginx/conf.d/default.conf && \
mkdir -p /var/cache/nginx && \
chown -R 1001 /var/cache/nginx /etc/nginx && \
chmod -R g=u /var/cache/nginx /etc/nginx
EXPOSE 9443
# Copies the nginx configuration template
COPY docker/nginx-gateway.conf.template docker/nginx.sh /usr/share/nginx/
RUN chmod 755 /usr/share/nginx/nginx.sh
# Copy include directory
COPY docker/includes /etc/nginx/includes
# Copy error pages
COPY docker/hawtio-?0?.html /usr/share/nginx/html/
# Copy the hawtconfig.json configuration file
COPY ${PACKAGE_PLUGIN}/public/hawtconfig.json /usr/share/nginx/html/
COPY --from=builder ${PLUGIN_NAME}/dist /usr/share/nginx/html/
COPY --from=envsubst /usr/bin/envsubst /usr/local/bin/
# Copy licenses
RUN mkdir -p /usr/share/hawtio/licenses
COPY docker/licenses /usr/share/hawtio/licenses
USER 1001
CMD ["/usr/share/nginx/nginx.sh"]
## Labels
LABEL name="hawtio/hawtio-online-console-plugin"
LABEL description="Hawtio Online Console Integrated Plugin"
LABEL maintainer="Paul Richardson <[email protected]>"