-
Clone the project:
$ git clone https://github.com/deepak41/docker-nodejs-sample-app.git
-
Go to the root folder of the project & build the docker image:
$ sudo docker build . -t deepak661/nodejs-web-app
-
Run a container from the image:
$ sudo docker run -p 45045:3000 -d deepak661/nodejs-web-app
-
Test the app:
$ curl -i localhost:45045
The app should be up and running.
To upload/push the image to Docker Hub (hub.docker.com/signup):
-
Login into docker hub from terminal:
$ sudo docker login -u "deepak661" -p "password" docker.io
-
Upload the image to docker hub:
$ sudo docker push deepak661/nodejs-web-app