Complete Docker compose deployment setup

- Add an API container entrypoint that waits for PostgreSQL, runs Prisma migrations, seeds demo data, and then starts NestJS.

- Keep Prisma CLI and seed dependencies available in the API runtime image and copy seed source dependencies into the container.

- Add Docker Compose healthchecks and health-based startup ordering for PostgreSQL, API, and Nginx web services.

- Add Docker initialization environment switches for migrations, seed, and startup retries.

- Add a dedicated Docker deployment guide covering services, ports, initialization, HTTPS, production variables, backup, restore, and troubleshooting.

- Update README, AGENTS, installation, deployment, progress, and environment example docs for the Dockerized workflow.
This commit is contained in:
2026-05-02 05:38:03 +08:00
parent 2cabe7e4fd
commit 5d936832da
12 changed files with 269 additions and 8 deletions

View File

@@ -187,6 +187,7 @@ cp .env.example .env.local
- [docs/features.md](./docs/features.md):功能真实性盘点。
- [docs/testing.md](./docs/testing.md):测试文档。
- [docs/data-storage.md](./docs/data-storage.md):本地数据存储说明。
- [docs/docker.md](./docs/docker.md)Docker Compose 一键部署、初始化、健康检查和生产变量。
- [docs/security.md](./docs/security.md):安全边界和风险。
- [docs/backendization-plan.md](./docs/backendization-plan.md):后端化、用户化改造方案。
@@ -241,10 +242,11 @@ docker-compose down
- `web` 服务使用 Nginx 托管前端 `dist/`
- Docker 前端同时暴露 `http://localhost:4002` 和自签名证书的 `https://localhost:4443`;麦克风听写建议使用 HTTPS 演示入口。
- `api` 服务运行 NestJS 后端,并把上传文件目录挂载到 `uploads_data` volume。
- `api` 服务运行 NestJS 后端,启动时默认执行 `prisma migrate deploy``prisma db seed`并把上传文件目录挂载到 `uploads_data` volume。
- `db` 服务运行 PostgreSQL 16。
- `nginx.conf` 已配置 SPA 路由回退、`/api` 反向代理和 `100m` 请求体上限。
- `nginx.conf` 已支持 `/api/speech/iat` WebSocket upgrade。
完整 Docker 说明见 [docs/docker.md](./docs/docker.md)。
## 当前限制