Day 85 - Project 6
2 min read
Project Description
The project involves deploying a Node JS app on AWS ECS Fargate and AWS ECR
Task-01
Get a NodeJs application from GitHub.
Build the Dockerfile present in the repo
Setup AWS CLI and AWS Login in order to tag and push to ECR
Setup an ECS cluster
Create a Task Definition for the node js project with an ECR image
prerequisite:
AWS CLI must be pre-installed on the local machine.
Docker must be installed.
Steps:
Clone a node app from docker(https://github.com/LondheShubham153/node-todo-cicd)
Create an ECR repository.
View Push Commands and run locally on the directory where the git clone the node-app
aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 822255583253.dkr.ecr.us-east-2.amazonaws.com docker build -t node-app . docker tag node-app:latest 822255583253.dkr.ecr.us-east-2.amazonaws.com/node-app:latest docker push 822255583253.dkr.ecr.us-east-2.amazonaws.com/node-app:latest
Now, Create a cluster on ECS(Elastic Container Service)
Create a Task Definition
Create a Service to connect to the node app
Select the task family and add the Task service name
select VPC and subnet
Copy the public address IP and paste it on the Browser
(Select service->Task->select the task->public IP)
Done!!๐๐