Node.js 78 🟢 Containerizing Node.js Applications with Docker
A Node.js application containerized naively produces an image over a gigabyte, runs as root, ships every dev dependency and the TypeScript compiler into production, and ignores SIGTERM when Docker tries to stop it gracefully. Each of these is fixable with a few Dockerfile lines, and the fixes are not new—multi-stage builds have existed since 2017—yet…