finds.dev

BretFisher/node-docker-good-defaults

sample node app for Docker examples

View on GitHub

★ 2,394JavaScriptMITupdated Jan 2026

// the take

A reference Dockerfile + Compose setup from Bret Fisher (known for Docker training content) showing how to run Node.js in Docker for local dev and production. It's a teaching example, not a library or framework — you copy the patterns into your own app rather than depend on this repo directly.

Solves the real node_modules-bind-mount-clobbering problem by installing dependencies outside the mounted app root. Uses `node index.js` directly instead of `npm start` so SIGTERM/SIGINT propagate correctly for graceful shutdown — a detail most Node Docker tutorials get wrong. Correctly separates NODE_ENV between dev (Compose) and prod (Dockerfile) so devDependencies don't leak into the production image, and runs as the non-root `node` user by default.

It's a toy app with a healthcheck that always returns 200 and a single trivial test file, so it demonstrates patterns rather than proving them under real load. Ships a `docker-stack.yml` for Swarm, which is a dead-end orchestrator for anyone starting fresh in 2026 — the patterns don't map cleanly to Kubernetes manifests. No secrets management story at all (env vars only), and nothing here addresses multi-stage builds for compiled/native dependencies, which is where most teams actually get stuck with Node Docker images.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
2,394
Forks
485
Language
JavaScript
License
MIT
Last commit
8 Jan 2026

// nearby

If node-docker-good-defaults isn't quite it.

All repos →