This article will guide you on how to build a Node.js Application with Docker on Ubuntu. npm install downloads a package and it's dependencies. #npm install can be run with or without arguments. When run without arguments, npm install downloads dependencies defined in a package. json file and generates a node_modules folder with the installed modules.
The #docker build command builds Docker images from a Dockerfile and a “context”.
A build's context is the set of files located in the specified PATH or URL . The build process can refer to any of the files in the context.
With Dockerfile written, you can build the image using the following command: $ docker build .
Containerizing an #application is the process of making it able to run and deploy under Docker containers and similar technologies that encapsulate an application with its operating system environment (a full system image).
Some Docker #commands:
1. docker run – Runs a command in a new container.
2. docker start – Starts one or more stopped containers.
3. docker stop – Stops one or more running containers.
4. docker build – Builds an image form a Docker file.
5. docker pull – Pulls an image or a repository from a #registry.