Getting Started with Node.js
Explore how to develop Node.js applications within Docker by building custom images and using Express.js for a simple hello-world app. Learn to manage dependencies with npm, configure scripts for production and development, and use Nodemon with debugging tools for efficient live coding inside containers.
We'll cover the following...
What is Node.js? 
Node.js is a popular, high-performance JavaScript runtime built with the Chrome browser’s V8 JavaScript engine. It’s typically used for server-side web development but has also been adopted for client-side build tools, desktop applications, embedded systems, and more.
After installing Node.js, you can execute a JavaScript file using:
node ./index.js
where index.js is a single entry script. It can be named anything, but many projects use that name.
Until now, you’ve been using Docker images provided at Docker Hub. This chapter illustrates how to build your own Docker image that installs and executes your application in both development and production environments.
Node.js is similar to other runtimes such as PHP, Python, Ruby, Go, and Rust. The same Docker concepts apply regardless of the runtime language you are using. ...