~/talk

Master Production-grade Best Practices to Build your Node.js Docker Images

Talkat OpenJS World 2021 · 2021-06-02..06-03· [nodejs, security]
slides:none on file

Pins base images by digest instead of FROM node:latest, uses npm ci --only=production with a lockfile to get deterministic, faster installs, and sets NODE_ENV outside install. Runs as a nonroot user and uses dumb-init to forward signals and enable graceful shutdowns. Demonstrates command injection via ImageMagick in an unpinned base and shows docker scan finding 624 vulnerabilities which drop to 58 by switching to a slimmer base. Uses multi stage builds and BuildKit secrets to avoid leaking tokens.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:44Why simplistic Dockerfiles fail
  3. 2:46Use explicit and deterministic image tags
  4. 6:15Install dependencies the right way
  5. 7:59Optimize libraries for production
  6. 9:41Run containers with least privilege
  7. 13:11Never run Node as PID 1
  8. 17:45Use a process manager like dumb-init
  9. 19:53Scan and fix image vulnerabilities
  10. 26:39Multi-stage builds for security
  11. 29:50Mount secrets safely with BuildKit
  12. 30:31Conclusion and resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.