refactor: 改用 Nitro 插件实现启动时数据库迁移
This commit is contained in:
@@ -125,8 +125,8 @@ const handler = new RPCHandler(router, {
|
||||
|
||||
- **Dockerfile**: Multi-stage — `oven/bun:1` (build + compile) → `gcr.io/distroless/cc-debian13:nonroot` (runtime)
|
||||
- **Runtime**: Bun-compiled standalone binary (glibc-linked, requires `cc` distroless variant)
|
||||
- **Compose**: `app` (port 3000) + `postgres:17-alpine` (port 5432) with health check
|
||||
- **Migrations**: Run separately — `bun run db:push` (dev) or `bun run db:migrate` (prod) against the compose DB
|
||||
- **Compose**: `app` + `db` with health check dependency
|
||||
- **Migrations**: Nitro plugin runs `migrate()` at server startup (see `src/server/plugins/migrate.ts`)
|
||||
- **Env**: `DATABASE_URL` set in `compose.yaml` pointing to the `db` service
|
||||
|
||||
## Git Workflow
|
||||
|
||||
Reference in New Issue
Block a user