Published May 18, 2022 | https://doi.org/10.59348/k6z7j-a6z38

Running Django apps on AWS Fargate with a serverless RDS

Creators & Contributors

  • 1. Birkbeck, University of London, English and Humanities

There are several tutorials out there on how to get Django apps dockerized and deployed onto AWS Fargate. None of them worked for me. So I have put together a project demonstrating how to do this. It's available on Github.

The scenario I wanted to create was something like this:

Diagram of containerized Django on AWS: DNS and load balancer feeding ECS services running Nginx and Django (Gunicorn) containers, with Aurora Postgres, Secrets Manager, CloudWatch alarms, and S3 log storage

I wanted the infrastructure to have:

  • Load balancing
  • SSL (with termination at the load balancer)
  • Serverless auto-scaling
  • Serverless database
  • Containerized Django

There were loads of "gotchas" along the way. For instance, getting two containers to run and interact with each other on the same network interface. The fact that you can't use docker-compose.yml "commands" to start the container. The load balancer wouldn't allow an HTTP target group for an HTTPS listener in extant modules. Getting the database to be accessible proved to be a networking pain. Setting the database password to a randomly generated string didn't work. The list goes on.

In any case, the project now seems to work!

Running Django apps on AWS Fargate with a serverless RDS was originally published by Martin Paul Eve at eve.gd: Martin Paul Eve on May 19, 2022.

Files

10.59348_k6z7j-a6z38.pdf

Files (266.4 kB)

Name Size Download all
md5:35ce55dbc4325a2013e4b4e63aef73e7
266.4 kB Preview Download

Additional details

Description

There are several tutorials out there on how to get Django apps dockerized and deployed onto AWS Fargate. None of them worked for me. So I have put together a project demonstrating how to do this. It's available on Github.

Identifiers

Dates

Issued
2022-05-18T00:00:00Z
Updated
2022-05-18T23:00:00Z