DEV Community

Discussion on: Dockerizing a Node.js Application from Scratch

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

A couple of points:

  1. We should all stop writing CommonJS and move to ES Modules. For Express applications, we should use express-generator-esmodules instead.
  2. When creating Docker images, it is best to use the npm ci command instead of npm install.

Cheers!

Collapse
 
hossainchisty profile image
Hossain Chisty

I am certainly grateful for your recommendations.

Cheers!

Collapse
 
webjose profile image
Info Comment hidden by post author - thread only visible in this permalink
José Pablo Ramírez Vargas

NP. Also what's up with the old Node image? There's Node v20 already. Your Dockerfile is pulling Node v14. :-P Get on board with new Node's!

Some comments have been hidden by the post's author - find out more