Skip to content

Latest commit

 

History

History
89 lines (67 loc) · 3.48 KB

README.md

File metadata and controls

89 lines (67 loc) · 3.48 KB

Create, build, package and deploy portfolio website using Express.js, Node.js and Docker (Continuous Integration using CircleCI)

CircleCI

Docker Image

Prerequisites Details

Command to build website locally:

  • Clone source code:
git clone https://github.com/jainishshah17/website.git
  • Install dependencies to build node server for website:
cd website/
## Install bower and bower-art-resolver to install your bower dependencies
npm install -g bower bower-art-resolver
## Install bower dependency packages
bower install
## Install npm dependency packages
npm install
  • Start node server to view website:
npm start

It will look like following ScreenShot: ScreenShot

  • Now its time for you to make changes in code to customise it and make it your portfolio website.

  • Change contents of .hbs files in views directory.

  • Once you are ready just restart you node server and refresh website page http://localhost:3000 in your browser.

Great!!! Now your website is developed locally. Let's follow the next step which is packaging it in Docker image.

Command to build and run docker image locally:

  • Build docker image:
docker build -t jainishshah17/website:latest .
  • Run docker image to test it locally
docker run -d -p 80:80 -p 443:443 -p 3000:3000 jainishshah17/website:latest
## Please login to Docker Registry prior to pushing docker image using `docker login` command
docker push jainishshah17/website:latest
  • Once your docker image if pushed to docker registry. You are ready to Deploy it in prodution.

Deploy docker image in production

There are multiple ways to deploy docker containers. You can choose any cloud provider from Azure, GCP and AWS.

Following are some ways which you can use:

Once you have your container deployed and you have External IP to access now its time to Buy a domain (e.g jainishshah.com) and link it with External IP of your deployed website container. There are multiple website who sells domain names following are couple of them:

I personally prefer the combination of AWS and GoDaddy. Here is the link learn how to point your domain to External IP your deployed website container.

Check out http://jainishshah.com/ to see the example website in action.