Quick CI-CD from Github to Prod with AWS ECR, ECS creating a serverless Docker container

Eli Elad Elrom
Master React
Published in
9 min readFeb 25, 2022

--

There are so many ways to configure your project CI-CD pipeline when deploying to Amazon Web Services (AWS). In this tutorial, I will give the rundown of how to set up a serverless docker container using AWS ECR ECS that would be suitable as a starting point for a smaller size startup or MVP project.

There are a large number of products of AWS such as CodeDeploy, CodeCommit, S3, CodeBuilt, CodePipeline, EC2, SNS, etc. These products are a good fit for certain configurations for example to create a build and run tests against that built or a build that demands more resources.

However, there are many cases that your App doesn’t need that many resources and can be deployed as Elastic Container Service(ECS) using a serverless compute engine (AWS Fargate) — think shared virtual server vs EC2 dedicated server.

This configuration reduces costs but allows easily scaling, take a look, at a diagram of setting up GitHub using git action to deploy a serverless container on ECS;

This opinionated CI-CD setup is quick and relatively simple but gives you the power of scaling only when needed and automating your deployment process;

Github Actions > Docker Image > ECR > ECS > AWS Fargate

--

--