From cb12d68fbeacdd697c97fec0445e8b97628872d9 Mon Sep 17 00:00:00 2001 From: Nicholas Ceballos Date: Mon, 1 Jun 2026 17:25:21 -0600 Subject: [PATCH] build(docker): replace envsubst with sed, drop gettext Replace nginx config environment variable substitution from envsubst to sed to eliminate the gettext package dependency, reducing the final container image size. Remove unused export statements from the docker-entrypoint.sh script. --- Dockerfile | 2 +- docker-entrypoint.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89e3145..4bd1ee4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ LABEL org.opencontainers.image.created="${BUILD_DATE}" LABEL org.opencontainers.image.revision="${GIT_COMMIT}" LABEL org.opencontainers.image.source="https://git.kubistudio.cloud/kubistudio/cicd-multi-env-pipeline-poc" -RUN apk add --no-cache curl gettext +RUN apk add --no-cache curl COPY nginx.conf /etc/nginx/nginx.conf COPY src/ /usr/share/nginx/html/ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index f2dd1ef..a278378 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -21,9 +21,9 @@ window.__ENV__ = { }; EOF -export APP_ENV APP_VERSION - -envsubst '${APP_ENV} ${APP_VERSION}' < /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.tmp -mv /etc/nginx/nginx.conf.tmp /etc/nginx/nginx.conf +sed -i \ + -e "s/\${APP_ENV:-development}/${APP_ENV}/g" \ + -e "s/\${APP_VERSION:-0.0.0}/${APP_VERSION}/g" \ + /etc/nginx/nginx.conf exec "$@"