Nuxt & Universal SSR (50 Qs)•Part 3: Advanced Internals, Performance & Production (Senior / Staff)
Zero-Downtime Deployment and Health Checks for Nuxt 3 Containers.
senior LevelFormsPerformanceDocker & Containers
In Simple Words: Deploying Nuxt 3 inside Docker/Kubernetes in enterprise environments requires:
- Multi-Stage Dockerfile: Builds with
npm run buildand runs output.output/server/index.mjson lightweight Node Alpine with nodevDependencies. - Health Check Endpoint: Create
server/routes/_healthz.tsreturning{ status: 'healthy' }for Kubernetes liveness and readiness probes. - Graceful Shutdown: Listen for
SIGTERMand allow Nitro to finish in-flight requests before container termination.