Day 85 - Project 6

2 min read

Cover Image for Day 85 - Project 6

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:

  1. AWS CLI must be pre-installed on the local machine.

  2. Docker must be installed.

Steps:

  1. Clone a node app from docker(https://github.com/LondheShubham153/node-todo-cicd)

  2. Create an ECR repository.

  3. 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
    

  4. Now, Create a cluster on ECS(Elastic Container Service)

  5. Create a Task Definition

  6. Create a Service to connect to the node app

    Select the task family and add the Task service name

    select VPC and subnet

  7. Copy the public address IP and paste it on the Browser

    (Select service->Task->select the task->public IP)

Done!!๐Ÿš€๐Ÿ’•