Disclaimer: Kubernetes was to be used to deploy this project, but since I am still to learn Kubernetes, I decided to stick with Amazon ECS which I am already familiar with.
This codebase is divided into 3 parts which are:
node_app
: is where the sample nodejs application resides. The Dockerfile that will later be used to create a docker image and push to dockerhub resides here too.
terraform_infra
: contains the terraform code that will create an ecs cluster, and deploy the nodejs application service on it.
This directory contains three workflows for building and pushing the nodejs image to dockerhub, provisioning infrastructure with terraform and deleting the infrastructure too.
It's important to note that, these workflows have been set to be triggered manually. These are the names of the different workflow files
apply_infra:
For creating the infrastructuredestroy_infra:
For destroying the infrastructurepush_img:
To build and push image to DockerHub