A production-grade Docker boilerplate for a NestJS 11 REST API running on Node.js 22. Part of a branded family of starter images by Lê Đức Minh (minhle202 on Docker Hub, DucMinhNe on GitHub).
Compiled TypeScript, multi-stage build, non-root runtime, built-in healthcheck, and graceful shutdown hooks — ready to deploy.
docker pull minhle202/nestjs-apidocker run --rm -p 3000:3000 minhle202/nestjs-apiOverride the port with the PORT env var:
docker run --rm -e PORT=8080 -p 8080:8080 minhle202/nestjs-apicurl http://localhost:3000/
curl http://localhost:3000/health
curl "http://localhost:3000/api/hello?name=Minh"{"name":"docker-nestjs-api","version":"1.0.0","endpoints":["/","/health","/api/hello"]}
{"status":"ok","uptime":12.34}
{"message":"Hello, Minh!"}| Method | Path | Description |
|---|---|---|
| GET | / |
Service metadata: name, version, available endpoints. |
| GET | /health |
Health probe: { "status": "ok", "uptime": <seconds> }. |
| GET | /api/hello?name= |
Greeting; name defaults to world. |
- Node.js 22 on Alpine — small, current LTS runtime.
- NestJS 11 with TypeScript, compiled via
nest buildtodist/. - Multi-stage Dockerfile —
builderstage installs deps and compiles,runtimestage carries only productionnode_modules+dist. - Non-root — runs as the unprivileged
nodeuser. - HEALTHCHECK — built-in container healthcheck hitting
/health. - Graceful shutdown —
app.enableShutdownHooks()for clean SIGTERM handling.
npm install
npm run start:dev # watch mode
npm run build # compile to dist/
npm start # node dist/main.jslatest— multi-arch manifest for linux/amd64 and linux/arm64.
MIT © 2026 Lê Đức Minh. See LICENSE.