Django Deployment Pipeline
- CI / CD with Git, GitHub, and GitHub Actions
- Django on Docker & DockerHub (as well as using WatchTower)
- Load Balancing with NGINX
- Production Databases with managed MySQL by Linode
- Local/Development use of production-like Databases
- Terraform to provision Infrastructure on Linode
- Ansible to configure infrastructure on Linode (in tandem with Terraform)
- Django-based File Uploads & Django Static Files on Linode Object Storage
- GitHub: a place to store our code, almost like a folder on your computer.
- GitHub Actions: an app that automatically starts a chain of events related to testing (verifying the document does what the writer intended), building (let's put a stamp on this code and say that this version is done), and running our code in production (find the code that should run the best, is ready, and let's and run that)
- Django: A bunch of python documents to handle the logic of an HTML website, store data, and handle user data.
- Docker: essentially a document that we write to describe, on the operating system level, how our Django app needs to run. Docker itself does more than this, but we mostly work on the document part (a Dockerfile).
- Load Balancing with NGINX: a document that we write to tell nginx to send incoming website traffic to the different servers running our Docker-based Django app. Managed databases: a powerful spreadsheet that you never need to open or touch (thanks to Linode & Django).
- Terraform: a document describing all of the products and services we need from Linode (like virtual machines) to run our Django project.
- Ansible: a few documents we use to tell all of the products and services what software our Django project needs is needed to run.
- Linode Object Storage: a file system (sort of) that allows us to store files that don't change very often like images and videos as well as other documents like CSS and some kinds of JavaScript.
References
Lessons
Welcome
1:30
Configure Early, Deploy Often
4:36
Rapid Project Setup
4:04
In Depth Project Setup
22:25
Git Github & GitHub Actions
27:18
GitHub Actions Workflow Pipeline
7:53
GitHub Actions for Django & MySQL
7:04
Install MySQL Client
0:43
Containerize Django with Docker
8:11
Your First Dockerfile
12:07
Build Docker Container
12:58
Production-Ready Docker Container
10:18
Docker Compose for MySQL & Dev Env
16:40
Provision Production-Grade Managed Dev Database - Part 1
8:43
Provision Production-Grade Managed Dev Database - Part 2
7:31
Provision Production-Grade Managed Dev Database - Part 3
14:59
Github Action to Configure MySQL Database -Part 1
18:13
Github Action to Configure MySQL Database -Part 2
8:59
Push Docker Container to Docker Hub
14:13
Django Collect Static Automation Workflow
14:57
Install & Inialize Terraform
14:10
Linode Personal Access Token
3:07
Generate New SSH Keys & A Root User Password
7:49
Main Terraform File
7:59
Terraform Variables
5:37
Provision Instances
13:42
Terraform Github Actions Automation
15:18
Terraform Output Values
7:23
Terraform Template for Ansible Inventory
15:20
First Steps with Ansible
18:27
Ansible Role to Install Docker & Docker Compose
21:00
Destroy & Rebuild Infrastructure
6:14
GitHub Actions for Ansible
12:42
Ansible Templates
11:48
Nginx Load Balancer Ansible Role
9:19
Ansible Variables
5:40
Docker-Based Django App via Ansible
22:23
Ansible Local Testing
22:50
Solving FIrst Deployment Issues
25:13
Deploy Often
8:50
Thank you and a final challenge
1:11