We have a Django web app which currently consists of several Docker containers, that are connected to one another. The main component of the web app is similar to this one here ([login to view URL]).
Currently, we can locally run the web app in prod by calling
docker-compose -f [login to view URL] up -d --build
docker-compose -f [login to view URL] exec web python3 [login to view URL] migrate --noinput
docker-compose -f [login to view URL] exec web python3 [login to view URL] collectstatic --noinput --clear
and similarly for dev. Now we want to automize that deployment to AWS. Specifically, the following things have to be adressed:
1. A working and cost-effective CI/CD pipeline: Automatic builds of Docker images upon changes (in the master branch) on GitHub and pushing them to ECR.
2. Terraform scripts for the dev and prod version for deployment, stopping all components of the web app on AWS, and doing rolling updates.
3. Configuring AWS to work with everything necessary for the points 1 and 2.
The Terraform scripts need to address the following points:
1. Deployment to ECS/Fargate
2. For the dev version we can make use of an sql container, but for the prod version we need to make use of a PostgreSQL Aurora DB, which should be connected in a suitable way to the Django DB.
3. Autoscaling for all components particularly for prod and load balancing. Is there a way to simulate heavy lead for individual containers?
4. The web app should be deployed in a multi-region way, such that you get connected to the region with the lowest latency, but all connect to the same Database.
5. Reservation of websites and connecting the web app to it and connecting the Django web app to some email instance.
6. Setting up a monitoring system for the components of the web app and sending alarms if something does not work, via E-Mail and Slack.
Everything should be configured to follow best practise and to be robust, reliable and cost-effective.
Last, but not least, we have to be onboarded of how make use of everything and get a good manual.
The code should be made available to us in a GitHub repository.