build: bake NEXT_PUBLIC_SF_SITE_URL into frontend image via ARG/build-args - #25
Merged
Merged
Conversation
added 2 commits
September 23, 2026 00:52
- * text=auto eol=lf: all text files stored & checked out as LF - common binary patterns marked binary (no EOL conversion) - LICENSE blob renormalized CRLF->LF (EOL-only, no content change)
youdingtianzhaogeyinzuo
previously approved these changes
Sep 22, 2026
youdingtianzhaogeyinzuo
approved these changes
Sep 22, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
NEXT_PUBLIC_*は Next.js の仕様上、ビルド時にクライアントバンドルへ静的埋め込みされる。CI(frontend-image.yml)には変数の供給経路がなく(Dockerfile に ARG なし / build-args なし / .dockerignore が .env* を除外)、
実行時の env_file 注入は既に配信済みのブラウザ JS に効かない。
その結果、管理画面の「Salesforce 管理ワークベンチ」ボタンの有効条件
isEnabled = mappingActive === true && !!sfSiteUrl(SalesforceWorkbenchEntry.tsx:29)の後半が常に undefined となり、DB・API・env がすべて正常でもボタンが無効のままだった。
変更内容
npm run buildの前)にARG NEXT_PUBLIC_SF_SITE_URL+ENVを追加docker/build-push-actionにbuild-argsを追加(値はリポジトリ変数vars.NEXT_PUBLIC_SF_SITE_URL。公開 URL のため secret ではなく variable を使用)動作要件
NEXT_PUBLIC_SF_SITE_URLが設定済みであること(設定済み・確認済み)マージ後の確認手順(booking-deploy 側)
docker compose -f compose/docker-compose.dev.yml --env-file compose/dev.compose.env pull frontendup -d --force-recreate frontend(タグは同じ develop でも digest が新しくなる)docker exec booking-frontend-dev sh -c 'grep -rc "my.site.com" /app/.next/static/chunks/ | grep -v ":0"'で 1 件以上ヒット注意・今後の課題
NEXT_PUBLIC_*はビルド時焼き込みのため、URL 変更時はイメージ再ビルドが必要(dev/prod で別イメージになる)NEXT_PUBLIC_API_URLも同根の未焼き込み(現在は localhost fallback で偶然動作)。別 PR で対応予定