Introduction

This blog post illustrate development cycle using django app container. I assume readers are already somewhat familar with docker and docker-compose. Although I used django for app development, it is language-agnostic since the post is about containerized application deployment.

Walkthough is devided into three parts consisting three different environemt respectively. First part, describes the architecture of the app(api and async worker) and how they are deployed on local enviroment. Second part is how to deploy the docker containers on cloud using single ec2 instance with on staging environment. Third part, illustrate how to convert traditional ec2 deployment into ECS using fargate with github actions on prod environment.

local - run docker containers on desktop/laptop with sqlite and redis server using docker-compose

stating - run docker containers on single ec2 instance with mysql RDS and ElasticCache

prod - convert stagning setup to ECS Fargate

If you want to take a look at previous part

How to deploy django app to ECS Fargate Part1

How to deploy django app to ECS Fargate part2

ECS fargate primer

https://www.youtube.com/watch?v=eq4wL2MiNqo

ECS provides container management service that makes it easy to run, stop, and manage Docker containers on a cluster. However you still have to manage container instances with container agent running on instances. With AWS Fargate, you no longer have to provision, configure, or scale clusters of virtual machines to run containers. It's a good idea to have some understanding on following components of ECS.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7be58353-37bb-41e0-b8b4-b58f5db2784b/Untitled.png

Components

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d48d58e6-5fb1-4d82-86f7-ac8cb2fb4454/Untitled.png

Cluster