fix(web, P0): nginx entrypoint 兼容外部 bind-mount,修复 staging 部署 web 无法启动 #1857

Closed
xiaoxia wants to merge 1 commits from fix/nginx-entrypoint-mount-conflict into develop
Owner

PR #1856 已先合入相同修复(e7ab963),本PR关闭。Deploy Staging 已成功,开始验证后端 lipsync 流程。

PR #1856 已先合入相同修复(e7ab963),本PR关闭。Deploy Staging 已成功,开始验证后端 lipsync 流程。
xiaoxia added 1 commit 2026-09-11 11:19:02 +08:00
fix(web, P0): nginx entrypoint 兼容外部 bind-mount 部署,修复 staging 部署后 web 无法启动
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 3s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 14s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 15s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m34s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m52s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 2m5s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m10s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m59s
AI Code Review / AI Code Review (pull_request) Successful in 6m25s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 8m26s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 9m48s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 9m55s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 5s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 22s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 123h54m50s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 124h3m11s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 124h3m28s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 124h4m44s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 124h3m14s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 124h3m15s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 124h3m30s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 124h4m29s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 124h4m30s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 123h54m35s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 123h54m35s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 123h54m31s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 123h54m31s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 124h2m56s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 124h2m56s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 124h3m1s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 124h3m46s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 124h4m33s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 124h38m53s
72aa5009be
根因:PR #1853 引入 nginx-entrypoint.sh 用于按 APP_ENV 切换配置,
但 staging/production CI 部署脚本通过
  -v /path/nginx-staging.conf:/etc/nginx/conf.d/default.conf:ro
把环境配置以只读 bind mount 提供,default.conf 已经是正确配置。
entrypoint 里的 rm -f 在只读挂载点失败,set -e 导致脚本直接退出,
nginx 从未启动,30s 健康检查失败触发自动回滚。
回滚到旧镜像(29ca51d,PR #1853 本身)后问题依然存在——
说明 PR #1853 引入的 entrypoint 本身就与现有部署方式不兼容,
第一次部署就已失败,#1855 的 rm+ln 修复只是解决了 alpine ln -sf 在
普通文件上的行为问题,未解决 bind-mount 冲突。

修复:entrypoint 检测 default.conf 是否可被 rm 替换:
- 可删(镜像自包含普通文件):按 APP_ENV 建立正确 symlink
- rm 失败(外部只读 bind mount):跳过替换,直接启动 nginx

🚀 预览环境已部署

项目 详情
PR号 #1857
预览链接 https://pr-1857.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1857 | | 预览链接 | [https://pr-1857.preview.xiaoxiajianji.com](https://pr-1857.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
Collaborator

Auto merge skipped after multiple 405 errors: PR may have conflicts or unresolved checks. Please review manually. This is not a CI failure.

Auto merge skipped after multiple 405 errors: PR may have conflicts or unresolved checks. Please review manually. This is not a CI failure.
xiaoxia closed this pull request 2026-09-11 11:41:42 +08:00

🗑️ 预览环境已清理

PR #1857 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1857 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Some checks are pending
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 3s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 14s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 15s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m34s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m52s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 2m5s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m10s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m59s
AI Code Review / AI Code Review (pull_request) Successful in 6m25s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 8m26s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 9m48s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 9m55s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 5s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 22s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 123h54m50s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 124h3m11s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 124h3m28s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 124h4m44s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 124h3m14s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 124h3m15s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 124h3m30s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 124h4m29s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 124h4m30s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 123h54m35s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 123h54m35s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 123h54m31s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 123h54m31s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 124h2m56s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 124h2m56s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 124h3m1s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 124h3m46s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 124h4m33s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 124h38m53s

Pull request closed

Sign in to join this conversation.