From 9d7bf0e95c03ceebdaff92b5a9236ca39d19c01f Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 16 Jan 2024 15:00:12 +0200 Subject: [PATCH] RED-8128 other fixes --- ...ication-config.sh => 09-set-application-config.sh} | 11 ++++------- docker/red-ui/40-check-config.sh | 9 +++++++++ docker/red-ui/Dockerfile | 5 ++++- 3 files changed, 17 insertions(+), 8 deletions(-) rename docker/red-ui/{40-set-application-config.sh => 09-set-application-config.sh} (95%) create mode 100755 docker/red-ui/40-check-config.sh diff --git a/docker/red-ui/40-set-application-config.sh b/docker/red-ui/09-set-application-config.sh similarity index 95% rename from docker/red-ui/40-set-application-config.sh rename to docker/red-ui/09-set-application-config.sh index 50f3530d5..5719e1ea8 100755 --- a/docker/red-ui/40-set-application-config.sh +++ b/docker/red-ui/09-set-application-config.sh @@ -58,10 +58,7 @@ echo '{ echo 'Env variables: ' cat /usr/share/nginx/html/ui/assets/config/config.json -echo 'Running with config: ' -cat /etc/nginx/nginx.conf - -echo 'Default config:' -cat /etc/nginx/conf.d/default.conf - -#nginx -g 'daemon off;' +echo 'Change files permissions:' +chown a+rw -R /etc/nginx/conf.d +chown a+rw /etc/nginx/conf.d/default.conf +ls -al /etc/nginx/conf.d diff --git a/docker/red-ui/40-check-config.sh b/docker/red-ui/40-check-config.sh new file mode 100755 index 000000000..409fc2024 --- /dev/null +++ b/docker/red-ui/40-check-config.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +echo 'Running with config: ' +cat /etc/nginx/nginx.conf + +echo 'Default config:' +cat /etc/nginx/conf.d/default.conf + +#nginx -g 'daemon off;' diff --git a/docker/red-ui/Dockerfile b/docker/red-ui/Dockerfile index 4dbd8f7c0..835b37180 100644 --- a/docker/red-ui/Dockerfile +++ b/docker/red-ui/Dockerfile @@ -35,6 +35,8 @@ RUN rm -rf /usr/share/nginx/html/* COPY --from=builder /ng-app/dist/apps/red-ui /usr/share/nginx/html/ui COPY version.json /usr/share/nginx/html/ui/assets/version/version.json +USER root + RUN chmod a+rw -R /etc/nginx/conf.d RUN chmod o+r -R /usr/share/nginx/html RUN chmod g+r -R /usr/share/nginx/html @@ -42,5 +44,6 @@ RUN chmod g+r -R /usr/share/nginx/html ## Change permissions to enable openShift functionality # RUN chmod -R g+rwx /var/cache/nginx /var/run /var/log/nginx /usr/share /etc/nginx -COPY docker/red-ui/40-set-application-config.sh docker-entrypoint.d/ +COPY docker/red-ui/09-set-application-config.sh docker-entrypoint.d/ +COPY docker/red-ui/40-check-config.sh docker-entrypoint.d/ #CMD ["/docker-entrypoint.sh"]