# Deployment — Golden Rules ## Containers - Every runnable service that ships to prod must have a Dockerfile. - Never use image tag `latest` in production. - Always semantic version tags: `v0.1.0` or git SHA. ## Health - Liveness: `GET /api/v1/healthz` required. - When DB is required for traffic: add readiness endpoint (e.g. `/api/v1/readyz`) that checks DB. - Alias names `/health` `/readiness` `/liveness` may map to the above; keep one canonical path documented in OpenAPI. ## Config - Secrets via env only. Commit `.env.example`, never `.env`. - Required: `APP_ENV`, `HTTP_ADDR`, `DATABASE_URL`. ## CI - No manual prod deploy as the happy path — CI builds and tags. - Minimum gates: `go test ./...` (api), `npm run build:h5`. ## Local ```bash docker compose -f deploy/docker-compose.yml up -d cd apps/api && go run ./cmd/server npm run dev:h5 ``` If Go module download times out in CN: `export GOPROXY=https://goproxy.cn,direct`.