Skip to content

Commit 96aa48d

Browse files
authored
chore: handle DASHBOARD_API_BASE_URL env at docker run time (#1231)
1 parent 3a75004 commit 96aa48d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ FROM python:3.12-slim AS runtime
7272
RUN apt-get update && apt-get install -y --no-install-recommends \
7373
libgomp1 \
7474
nginx \
75+
gettext-base \
7576
&& rm -rf /var/lib/apt/lists/*
7677

7778
# Create a non-root user
@@ -81,6 +82,7 @@ RUN useradd -m -u 1000 -r codegate
8182
# Set permissions for user codegate to run nginx
8283
RUN chown -R codegate /var/lib/nginx && \
8384
chown -R codegate /var/log/nginx && \
85+
chown -R codegate /etc/nginx && \
8486
chown -R codegate /run
8587

8688
COPY nginx.conf /etc/nginx/nginx.conf

scripts/entrypoint.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,11 +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
3531
echo "Starting the dashboard..."
32+
33+
envsubst '${DASHBOARD_API_BASE_URL}' < /var/www/html/index.html > /var/www/html/index.html.tmp && mv /var/www/html/index.html.tmp /var/www/html/index.html
34+
3635
nginx -g 'daemon off;' &
3736
}
3837

0 commit comments

Comments
 (0)