From 668ee78da321ad7ac4fb2cab8fdf329e1e6bb5fa Mon Sep 17 00:00:00 2001 From: Matthew White Date: Thu, 10 Aug 2023 22:48:00 -0400 Subject: [PATCH] Does environment work instead of build.args? --- docker-compose.yml | 7 +++---- files/prebuild/build-frontend.sh | 7 ++++--- nginx.dockerfile | 7 ++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6d317637..e1e5c76e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -77,10 +77,6 @@ services: nginx: build: context: . - args: - - OIDC_DISCOVERY_URL=${OIDC_DISCOVERY_URL:-''} - - OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-''} - - OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-''} dockerfile: nginx.dockerfile depends_on: - service @@ -92,6 +88,9 @@ services: - SENTRY_ORG_SUBDOMAIN=${SENTRY_ORG_SUBDOMAIN:-o130137} - SENTRY_KEY=${SENTRY_KEY:-3cf75f54983e473da6bd07daddf0d2ee} - SENTRY_PROJECT=${SENTRY_PROJECT:-1298632} + - OIDC_DISCOVERY_URL=foobar + - OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-''} + - OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-''} ports: - "${HTTP_PORT:-80}:80" - "${HTTPS_PORT:-443}:443" diff --git a/files/prebuild/build-frontend.sh b/files/prebuild/build-frontend.sh index 799d7ebb..f5e51696 100755 --- a/files/prebuild/build-frontend.sh +++ b/files/prebuild/build-frontend.sh @@ -1,7 +1,8 @@ #!/bin/bash -eu +echo "\$OIDC_DISCOVERY_URL in build-frontend.sh: [${OIDC_DISCOVERY_URL:-blank}]" cd client npm clean-install --no-audit --fund=false --update-notifier=false -if [[ -n $OIDC_DISCOVERY_URL && -n $OIDC_CLIENT_ID && -n $OIDC_CLIENT_SECRET ]]; then - export VUE_APP_OIDC_ENABLED=true -fi +# if [[ -n $OIDC_DISCOVERY_URL && -n $OIDC_CLIENT_ID && -n $OIDC_CLIENT_SECRET ]]; then +# export VUE_APP_OIDC_ENABLED=true +# fi npm run build diff --git a/nginx.dockerfile b/nginx.dockerfile index 6ddfb91e..fd842e4a 100644 --- a/nginx.dockerfile +++ b/nginx.dockerfile @@ -1,12 +1,9 @@ FROM node:18.17 as intermediate -ARG OIDC_DISCOVERY_URL -ARG OIDC_CLIENT_ID -ARG OIDC_CLIENT_SECRET COPY ./ ./ RUN files/prebuild/write-version.sh -RUN OIDC_DISCOVERY_URL="$OIDC_DISCOVERY_URL" OIDC_CLIENT_ID="$OIDC_CLIENT_ID" OIDC_CLIENT_SECRET="$OIDC_CLIENT_SECRET" \ - files/prebuild/build-frontend.sh +RUN echo "\$OIDC_DISCOVERY_URL in the Dockerfile: [${OIDC_DISCOVERY_URL:-blank}]" +RUN files/prebuild/build-frontend.sh # when upgrading, look for upstream changes to redirector.conf # also, confirm setup-odk.sh strips out HTTP-01 ACME challenge location