From ab1d27955f2e35ff1f7f591e977c6600ddc46b7c Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 29 Oct 2024 08:02:11 +0100 Subject: [PATCH] Add run-time variable to skip ENV validation --- Dockerfile | 4 ++++ deploy/scripts/entrypoint.sh | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ca3d27f88..b46aa07ab4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -126,6 +126,10 @@ ARG ENVS_PRESET ENV ENVS_PRESET=$ENVS_PRESET COPY ./configs/envs ./configs/envs +# Pass ENV for skipping ENVs validation in entrypoint script +ARG SKIP_ENVS_VALIDATION +ENV SKIP_ENVS_VALIDATION=$SKIP_ENVS_VALIDATION + # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ diff --git a/deploy/scripts/entrypoint.sh b/deploy/scripts/entrypoint.sh index 298303c7a0..ac1f91d6c5 100755 --- a/deploy/scripts/entrypoint.sh +++ b/deploy/scripts/entrypoint.sh @@ -39,9 +39,14 @@ export_envs_from_preset ./download_assets.sh ./public/assets/configs # Check run-time ENVs values -./validate_envs.sh -if [ $? -ne 0 ]; then - exit 1 +if [ "$SKIP_ENVS_VALIDATION" != "true" ]; then + ./validate_envs.sh + if [ $? -ne 0 ]; then + exit 1 + fi +else + echo "😱 Skipping ENVs validation." + echo fi # Generate favicons bundle