Minimal Node.js 22 + Fastify REST API starter — multi-stage, non-root, healthcheck. Multi-arch.
371
A minimal, production-ready Node.js 22 + Fastify REST API starter in a small, multi-stage Docker image. Use it as a clean foundation for building HTTP services without the boilerplate.
docker pull minhle202/node-api
docker run --rm -p 3000:3000 minhle202/node-api
curl http://localhost:3000/health
curl "http://localhost:3000/api/hello?name=Minh"
GET / — service info JSON (name, version, available endpoints).GET /health — health check returning { "status": "ok", "uptime": <seconds> }.GET /api/hello?name= — greeting; name defaults to world.node:22-alpine base — small footprint.npm ci --omit=dev, then copied into a clean runtime layer.node user./health using Node's native fetch (no curl/wget needed).SIGTERM / SIGINT.| Env var | Default | Description |
|---|---|---|
PORT | 3000 | Listen port |
HOST | 0.0.0.0 | Bind address |
LOG_LEVEL | info | Fastify logger level |
NODE_ENV | production | Set in the image |
Override at runtime:
docker run --rm -p 8080:8080 -e PORT=8080 minhle202/node-api
MIT © Lê Đức Minh
Content type
Image
Digest
sha256:9809a7271…
Size
56.1 MB
Last updated
4 months ago
docker pull minhle202/node-api