Serving a node application in Docker is actually fairly simply. In this post, we’ll do so using only a six-line Dockerfile!
For our proof-of-concept, we’ll create a sample node app in a new directory. Let’s quickly put one together.
First create a node-in-docker
directory and cd
into it.
mkdir node-in-docker
cd node-in-docker
Next, initialize an npm project. The -y
flag will initilize with default settings.
npm init -y
#node #nodejs #docker