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

@@ -38,7 +38,6 @@ docker compose version
第一次启动:
```bash
npm install
docker compose up -d --build
```
@@ -62,6 +61,8 @@ curl http://localhost:3002/api/health
- `tuwen_api`NestJS API容器内监听 `3100`,宿主机端口 `3002`
- `tuwen_db`PostgreSQL 16宿主机端口 `5433`
首次启动时,`tuwen_api` 会等待数据库健康,自动执行 `prisma migrate deploy``prisma db seed`,再启动 API。完整 Docker 部署细节见 [Docker 化部署](./docker.md)。
查看状态:
```bash