Files
Mdeical_Sur_Report/工程分析/实现方案-2026-04-16-19-18-14.md

26 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 实现方案 — 2026-04-16-19-18-14
## 部署步骤
1. **构建生产包**:运行 `npm run build` 先本地验证构建是否通过(可选但推荐)。
2. **停止旧容器**`docker-compose down` 停止并移除当前运行的 `medical-report-app` 容器。
3. **重新构建镜像**`docker-compose build --no-cache` 基于最新代码重新构建 Docker 镜像。
4. **启动新容器**`docker-compose up -d` 后台启动新容器。
5. **验证部署**:检查容器状态 `docker ps`,并尝试访问 `http://localhost:8080` 确认应用正常。
## 修改文件清单
无需修改源代码,仅执行构建和容器操作。
## 风险点
| 风险 | 级别 | 应对措施 |
|------|------|---------|
| 构建失败 | 低 | 本地已执行 `tsc --noEmit` 通过,构建风险低 |
| 端口 8080 被占用 | 低 | `docker-compose down` 会先释放旧容器占用的端口 |
| Docker 未安装/未启动 | 中 | 如遇报错,根据错误信息处理 |
## 回滚策略
若部署后异常,可执行 `docker-compose down` 后回退到上一个可用的 Git commit 再重新构建。