Sampe webapp setup to build a docker image of app and run.
- Build docker image
$ git clone https://github.com/sandeshchoudhary/node-docker.git
$ cd node-docker
$ docker build -t nodedocker .
- Run docker image
$ docker run -p 4000:3031 nodedocker
- Run the app in the background, in detached mode:
$ docker run -d -p 4000:3031 nodedocker
Now Go to http://localhost:4000
- Get container id for App
$ docker container ls
- Stop docker image
$ docker container stop CONTAINER ID