fix(docker): 補 ARG VITE_SITE_URL 讓 Zeabur staging 建置生效(issue 682) - #685
Merged
s123104 merged 1 commit intoJul 8, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
- builder stage 宣告 ARG VITE_SITE_URL:Zeabur 服務層環境變數得以進入 multi-stage vite build, staging manifest start_url/scope 正確指向 staging;不搭 ENV,RUN 內空字串 unset 防護回退鏈 - install 前補 COPY patches:修復 issue 622 引入 patchedDependencies 後容器 pnpm install ENOENT - 移除 apk git 與三段 git 回退死碼(.dockerignore 排除 .git,容器內回退必然靜默失敗) - 兩張誤入庫 QA 截圖出庫(.gitignore 既有 .playwright-mcp/ 防護) 測試:VITE_SITE_URL=staging pnpm build:ratewise 產物 manifest 與 canonical 指向 staging; 無變數 build 產物回退正式站且 tracked manifest 零差異;build-scripts.test.ts 48 項全綠 Co-authored-by: Cursor <cursoragent@cursor.com>
s123104
force-pushed
the
fix/682-dockerfile-arg
branch
from
July 8, 2026 01:28
4db1249 to
8b7383d
Compare
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.
Closes #682
摘要
ARG VITE_SITE_URL:Zeabur 服務層環境變數自此可進入 multi-stage vite build,fix(ratewise): manifest 網域改由 VITE_SITE_URL 環境驅動 #613 的 manifest 環境驅動修正在 staging 不再斷鏈(QA-I D7 根因)generate-manifest.mjs的process.env.VITE_SITE_URL || APP_INFO.siteUrl與 seo-metadata 的?? APP_INFO.siteUrl回退鏈不被空字串污染;RUN 內另加空字串 unset 防護(Zeabur 傳空值情境)COPY patches ./patches:fix(ratewise): 修復內容頁與 404 頁殘留的 React #418 hydration mismatch #622 引入patchedDependencies(vite-react-ssg@0.8.9.patch)後,容器內pnpm install --frozen-lockfile缺 patch 檔必炸 ENOENT,本修正一併堵住apk add git與三段 git 回退死碼:.dockerignore既排除.git,容器內git rev-list/git rev-parse必然失敗且被export VAR="$(...)"靜默吞掉(exit status 為 export 的 0),版本 metadata 一律由 build args 提供(build-docker.shSSOT)兩情境驗證(issue #682 驗收標準)
情境 1 — 帶變數(staging):
dist/manifest.webmanifest:start_url=scope=https://ratewise-staging.zeabur.app/ratewise/✅dist/index.htmlcanonical 同步指向 staging ✅情境 2 — 無變數(正式站回退):
dist/manifest.webmanifest:start_url=scope=https://app.haotool.org/ratewise/✅public/manifest.webmanifest與 committed 版本零差異)✅單元測試:
build-scripts.test.ts48 項全綠(含 manifest generatornormalizeSiteUrl(process.env.VITE_SITE_URL || APP_INFO.siteUrl)契約與 committed manifest 必為正式站守門)。衛生項清單
.playwright-mcp/*.pnggit rm).gitignore已有.playwright-mcp/防再犯(第 92 行既有,無需補)docs/dev/002新增 reward 條目,檔頭重算 +193 → +194(verify-002-log.mjs通過)測試
測試:兩情境 build 產物驗證(staging 指向與正式站零變化)、
build-scripts.test.ts48 項全綠、pre-push 完整驗證通過Made with Cursor