- root deno.json workspace (nodeModulesDir auto), npm versions registered once in imports, deno.lock; remove pnpm-lock/pnpm-workspace/root package.json; members keep minimal package.json (name/type/exports) - tasks: dev, typecheck (tsc 7.0.2 per member + deno check), lint/fmt (biome, useImportExtensions), test (vitest via deno), check:tokens, build (web + deno compile), ci, db:migrate/reset, gen:types - tsconfig base moved to config/ (no root tsconfig.json); deno types -> types/deno.d.ts; web drops baseUrl - server: Deno.serve entry with graceful shutdown, --role migrate|preflight|probe, WEB_ROOT static SPA hosting; drop @hono/node-server, tsx, esbuild build.mjs - logger: redact child() bindings and serialize err by message/stack; sync stdout destination; tests - relative imports get explicit extensions (sites/mp-sync paths left for follow-up) - crash-recovery tests spawn `deno run -A`; tasks tests use unique per-file schemas - single-container Dockerfile + entrypoint (migrate -> preflight -> api+worker watchdog), docker-compose.yml - docs: README, runbook, ADR-001 superseded, plan §1 validation row Co-Authored-By: Claude Fable 5.1 <[email protected]>
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
# 生产/试运行部署:app(单容器:API + worker + web 静态)+ postgres 两个服务。
|
|
# 用法:
|
|
# export SECRET_MASTER_KEY=$(openssl rand -hex 32) POSTGRES_PASSWORD=$(openssl rand -hex 16)
|
|
# docker compose up -d --build
|
|
# 开发只起数据库用 docker-compose.dev.yml。
|
|
name: umt
|
|
|
|
x-logging: &logging
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "5"
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: umt
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?请设置 POSTGRES_PASSWORD}
|
|
POSTGRES_DB: umt
|
|
volumes:
|
|
- umt-pg-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U umt -d umt"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
logging: *logging
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
args:
|
|
APP_VERSION: ${APP_VERSION:-}
|
|
image: uhd-media-tool:${APP_VERSION:-latest}
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: production
|
|
DATABASE_URL: postgres://umt:${POSTGRES_PASSWORD}@postgres:5432/umt
|
|
SECRET_MASTER_KEY: ${SECRET_MASTER_KEY:?请设置 SECRET_MASTER_KEY(至少 32 字节随机串)}
|
|
LOG_LEVEL: ${LOG_LEVEL:-info}
|
|
ports:
|
|
- "${UMT_PORT:-4380}:4380"
|
|
stop_grace_period: 15s
|
|
logging: *logging
|
|
|
|
volumes:
|
|
umt-pg-data:
|