Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
nestjs-deployment【部署与运维】Containerize NestJS apps with multi-stage Docker builds, tune Node.js memory, and implement graceful shutdown hooks. Use when writing Dockerfiles, configuring K8s deployments, or adding shutdown hooks for NestJS.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
nest build; run stage copies only dist and pruned node_modules.USER node to Dockerfile.--max-old-space-size to ~75% of container memory limit.app.enableShutdownHooks() in main.ts.node --max-old-space-size=XXX dist/mainSIGTERM.app.enableShutdownHooks() mandatory.main.ts on startup.npm run typeorm:migration:run before app container starts.src/config/env.validation.ts to add new environment variable, you MUST map it explicitly in your deployment pipeline/infrastructure-as-code.Deployment manifest or ConfigMap/Secret.serverless.yml or provider console.USER node to Dockerfile; running as root security risk.--max-old-space-size to ~75% of container memory limit.