Skip to content

Commit 6656044

Browse files
authored
Add support for runtime override of dashboard url. (#1088)
1 parent 6634fca commit 6656044

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ COPY --from=builder /app /app
100100

101101
# Copy necessary artifacts from the webbuilder stage
102102
COPY --from=webbuilder /usr/src/webapp/dist /var/www/html
103+
USER root
104+
RUN chown -R codegate /var/www/html
105+
USER codegate
106+
103107
# Expose nginx
104108
EXPOSE 9090
105109

scripts/entrypoint.sh

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ generate_certs() {
2828

2929
# Function to start Nginx server for the dashboard
3030
start_dashboard() {
31+
if [ -n "${DASHBOARD_BASE_URL}" ]; then
32+
echo "Overriding dashboard url with $DASHBOARD_BASE_URL"
33+
sed -ibck "s|http://localhost:8989|http://$DASHBOARD_BASE_URL:8989|g" /var/www/html/assets/*.js
34+
fi
3135
echo "Starting the dashboard..."
3236
nginx -g 'daemon off;' &
3337
}

0 commit comments

Comments
 (0)