Skip to content

Commit

Permalink
Does environment work instead of build.args?
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-white committed Aug 11, 2023
1 parent cb643b7 commit 668ee78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions files/prebuild/build-frontend.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions nginx.dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 668ee78

Please sign in to comment.