From 50e302584ff2928403fa36e8541b9ca60a25b014 Mon Sep 17 00:00:00 2001 From: Michelangelo Mori <328978+blkt@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:56:20 +0100 Subject: [PATCH] Add support for runtime override of dashboard url. --- Dockerfile | 4 ++++ scripts/entrypoint.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0cf87ec1..287c765d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,6 +100,10 @@ COPY --from=builder /app /app # Copy necessary artifacts from the webbuilder stage COPY --from=webbuilder /usr/src/webapp/dist /var/www/html +USER root +RUN chown -R codegate /var/www/html +USER codegate + # Expose nginx EXPOSE 9090 diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 45a6e3e2..b28f6704 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -28,6 +28,10 @@ generate_certs() { # Function to start Nginx server for the dashboard start_dashboard() { + if [ -n "${DASHBOARD_BASE_URL}" ]; then + echo "Overriding dashboard url with $DASHBOARD_BASE_URL" + sed -ibck "s|http://localhost:8989|http://$DASHBOARD_BASE_URL:8989|g" /var/www/html/assets/*.js + fi echo "Starting the dashboard..." nginx -g 'daemon off;' & }