Skip to content

Commit

Permalink
Add run-time variable to skip ENV validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Oct 29, 2024
1 parent 70b2a69 commit ab1d279
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./
Expand Down
11 changes: 8 additions & 3 deletions deploy/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab1d279

Please sign in to comment.