Repository navigation
Conversation
- 后端 Dockerfile:多阶段 rust:1-bookworm → debian:bookworm-slim,先用假入口编依赖以复用层缓存,非 root uid 10001 运行,装 curl 供 healthcheck - 前端 Dockerfile:多阶段 node:24-bookworm-slim → nginx:stable-alpine,VITE_* 经 build.args 注入 - frontend/nginx.conf:/api 读超时 120s(覆盖微信扫码登录 30s 长轮询)、/ws 透传 Upgrade 且读超时 300s、gzip + gzip_static、/assets/ immutable 而 index.html no-cache、SPA 回退,末尾附容器内终结 TLS 注释模板 - docker-compose.yml:只暴露 80(TLS 交前置反代),frontend 以 service_healthy 依赖 backend,mem_limit 512m/128m 对齐 2 核 2G 预算,日志命名卷持久化 - 前端接入 vite-plugin-compression2 生成 .gz 产物(index.js 325KB→101KB) - 根 .env.example、README 部署章节、DESIGN §8、CHANGELOG 同步
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.
变更说明
将
dev的 M6 部署改动合并到main。本次dev领先main仅一个 squash 提交(1f36d98,即 PR #16)。M6 = SPEC §6 最后阶段「打磨:异常处理、限流、部署 → 可上线的 v1.0」,本 PR 交付其中的部署部分。
内容
.dockerignorefrontend/nginx.conf:API 与 WS 反代、gzip +gzip_static、缓存策略、SPA 回退、容器内终结 TLS 注释模板docker-compose.yml:只暴露 80(TLS 交前置反代)、service_healthy依赖、内存上限、日志命名卷vite-plugin-compression2).env.example变更类型
chore构建/依赖/杂项目标分支
main(仅发版合并,dev → main)自查清单
dev上的 PR chore(deploy): M6 Docker Compose 部署与构建期 gzip 预压缩 #16 CI 全绿(Backend fmt/clippy/test、Frontend lint/typecheck/test/build)docker compose build+up -d实跑验证通过(health / gzip / 缓存头 / WS 反代 / SPA 回退 / env 注入).env.example).env仍由 gitignore 覆盖)关联 issue / 备注
按约定本次不打 tag。部署机升级方式:
git pull && docker compose up -d --build;首次部署需先cp .env.example .env并设置SERVER_SECRET。