Docker, Django, React, AWS: Deploying Containerized Application to Cloud
In the fast-paced field of web applications, containerization has become not only common but the preferred mode of packaging and delivering web applications. Containers allow us to package our applications and deploy them anywhere without having to reconfigure or adapt our applications to the deployment platform.
Amazon Elastic Container Service (Amazon ECS) is the service Amazon provide to run Docker applications on a scalable cluster.
[TOC]
Build an Application Using Django and React
For this application, React serves as the front-end or client side framework, handling UI and getting and setting data via requests to the Django back-end, which is an API built using the Django REST framework (DRF).
- React is a JS framework that is great for developing SPAs (single page applications) and it has solid documentation and a vibrant ecosystem around it.
- Django is a Python web framework that simplifies common practices in web development. Django has been around for a while, meaning most gotcha’s and problems have been solved, and there’s a set of stable libraries supporting common development needs.
Work-flow
- Setting up the Back-end
Creating an Application with Docker Compose
Key benefit: if it works locally, it works in production.
Setup Docker
Add NGINX Proxy
Modifying Settings Files
Deploy Docker Containers on Amazon ECS
Reference
- Creating an app with Docker Compose, Django, and Create React App
- Docker, Django, React: Building Assets and Deploying to Heroku
- Deploying Django Applications to AWS EC2 with Docker
- Deploying Django to AWS with Docker and Let’s Encrypt
- Deploy Docker Containers on Amazon Elastic Container Service (Amazon ECS)
Docker, Django, React, AWS: Deploying Containerized Application to Cloud