From 785ce83c511a119d4bbbefa73801cbddb85065b1 Mon Sep 17 00:00:00 2001 From: BFahy Date: Sun, 7 Dec 2025 09:24:19 +1000 Subject: [PATCH] refactor(docker): make Dockerfile OpenShift compatible Updates the base image for the API and Config UI builds to run correctly on OpenShift. No functional behavior changes intended outside container build/runtime. For issue #8504 --- backend/Dockerfile | 5 +++++ config-ui/Dockerfile | 2 ++ grafana/Dockerfile | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/backend/Dockerfile b/backend/Dockerfile index c93b30c6a3f..69cbeca7add 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -173,6 +173,11 @@ COPY --from=build /app/resources /app/resources ENV PATH="/app/bin:${PATH}" ENV DEBUG="$DEBUG" +USER root +RUN chgrp -R 0 /app && \ + chmod -R g=u /app +USER devlake + #add tini, prevent zombie process ENTRYPOINT ["/usr/bin/tini", "--"] diff --git a/config-ui/Dockerfile b/config-ui/Dockerfile index 25cd6dc2c03..7fadb956bda 100644 --- a/config-ui/Dockerfile +++ b/config-ui/Dockerfile @@ -44,5 +44,7 @@ EXPOSE 4000 4443 RUN apt update && apt install -y apache2-utils iproute2 COPY --from=builder /home/node/code/nginx.sh /usr/bin/nginx.sh RUN chmod +x /usr/bin/nginx.sh +RUN chgrp -R 0 /etc/nginx /var/log/nginx /usr/share/nginx /run && \ + chmod -R g=u /etc/nginx /var/log/nginx /usr/share/nginx /run USER 101 CMD /usr/bin/nginx.sh diff --git a/grafana/Dockerfile b/grafana/Dockerfile index 73f9ddae977..406e7c9a09f 100644 --- a/grafana/Dockerfile +++ b/grafana/Dockerfile @@ -34,4 +34,8 @@ ENV GF_SERVER_SERVE_FROM_SUB_PATH=true ENV GF_DASHBOARDS_JSON_ENABLED=true ENV GF_LIVE_ALLOWED_ORIGINS='*' ENV GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/etc/grafana/dashboards/Homepage.json +USER root RUN grafana-cli plugins install grafana-piechart-panel +RUN chgrp -R 0 /etc/grafana /usr/share/grafana /var/lib/grafana && \ + chmod -R g=u /etc/grafana /usr/share/grafana /var/lib/grafana +USER 101