Docker builds, Memory tuning, and Graceful shutdown. Use when containerizing NestJS apps, tuning memory, or implementing graceful shutdown. (triggers: Dockerfile, k8s/**, helm/**, Dockerfile, max-old-space-size, shutdown hooks)
Docker optimization and production deployment standards for NestJS applications.
devDependencies, build NestJS (nest build).dist and node_modules (pruned), use node:alpine.root.
USER node.node --max-old-space-size=XXX dist/mainSIGTERM.app.enableShutdownHooks() is mandatory.main.ts on startup.npm run typeorm:migration:run before the app container starts.src/config/env.validation.ts to add a 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 is a security risk.--max-old-space-size to ~75% of container memory limit.