Deploying Django with Docker Compose

preview_player
Показать описание
How to deploy a Django app to an EC2 instance using Docker Compose.

Resources:

CHECK OUT OUR COURSES

00:00:00 - Introduction
00:01:22 - Requirements
00:02:26 - Creating a new project on Github
00:04:22 - Setup Docker in our project
00:14:50 - Create a Docker Compose file for running development server
00:18:42 - Create a .dockerignore file
00:30:04 - Add a database to use for our application
00:33:55 - Add the Postgres driver to our Django application
00:41:05 - Create a model that we can test with in Django
00:41:14 - Create a new app in our Django project to add the model to
00:48:35 - Add a wait for db command
00:56:34 - Update Docker Compose file to handle migrations and run this command before we start the app
00:59:37 - Configure our application to handle static and media files
01:02:00 - Configure our application to handle these static and media files
01:10:37 - Test our local development server
01:15:35 - Adding the uWSGI_params file
01:24:20 - Start the NGINX server
01:25:08 - Create a Docker file inside our proxy
01:27:42 - Define default environment variables
01:33:12 - Configure our Django app to run as a uWSGI service
01:59:40 - Test to ensure we can upload images in production mode
02:01:51 - Deploy to an AWS server
02:04:46 - Create a virtual machine
02:09:48 - Installing Git
02:12:49 - Update project code and push to Github
02:13:00 - Set up a deploy key
02:17:01 - Clone and run the service
02:18:07 - Add the configuration
02:19:56 - Launch our application
02:21:16 - Create a superuser to test with
Рекомендации по теме
Комментарии
Автор

Following along this video allowed me to host my first ever webpage! Thank you lots!

idkman
Автор

2.5 hours of pure information and experience. Thank you so much.

gekare
Автор

Great Thanks for this video! It was very hard to digest for the first deployment, but carefully breaking down and playing around with each step help me a lot to deeper understand what is going on and why I should use a more complex approach

solarsystem
Автор

The best tutorial and instructor I've seen on the subject. really amazing <3

metalmlover
Автор

This is by far the best tutorial on Django deployment and the best on Docker. Great explanation on every detail. Thanks so much Mark!

janekalam
Автор

I am so thankful for your video Mark. You are an excellent, EXCELLENT teacher. One of the best tutorials for CS on Youtube for any subject! Keep up the wonderful work and I will be praying for your channel to grow even more!

lukeanglin
Автор

This is the best tutorial I have seen on deploying docker containers, I applied similar method to deploying on Linode. I learned a lot and I can't wait to get the full course. Great work Mike

ajagaabdulbasit
Автор

Still perfect after two years. Great work! The best method I've ever seen about deploying the app to EC2.

ahmetkemalbabacan
Автор

THIS. I can finally replace all my hacky docker workarounds and understand what I'm actually doing. Mark, you're the best

jasonoesch
Автор

Great video Mark, keep up the good work! I like the way you slowly explain what you do with no extra unnecessary "decorative" remarks. Hope to have a pint of beer with you sometime in London mate!

tomaszmakuch
Автор

Hey Mark, really appreciate for your tutorial. This is the exactly video I was looking! It was so detailed and you explain everything so well. Thank you!❤

Yuyoukyu
Автор

If anyone is facing the PermissionError: [Errno 13] Permission denied: '/vol/web/media' issue, here's the fix:-

TLDR fix - enter this command in the terminal from inside the root folder - "sudo chmod -R a+rwx ./data"


Explanation - So, in the docker-compose.yml, because we added ./data/web:/vol/web, under volumes, when we upload a file, it uses the same app user specified in the Dockerfile to write the uploaded file to the ./data folder. So making the /data folder writable fixes the issue

rawgov
Автор

Been trying to find this!! thank you again Mark, you never cease to amaze me and be on the right time ahaahaha

joshuaochia
Автор

This is exactly what I have been looking for. I took your "Rest API" course on Udemy and learned a lot. Thanks again.

RR-vioz
Автор

Increadibly proffessional. Blog and the video itself. I am amazed. Thank you so much.

youtalky_com
Автор

Ultimate explanation and the integration. Thanks for such excellent presentation and work.

sanjaydhande
Автор

very well explained the part of wsgi, nginx, static files . Very good

enricosaccheggiani
Автор

Uploaded at the right time. You're a Legend!

Mrsubset
Автор

Thanks for taking out time to create this tutorial. This video sooo good that I had to purchase the advanced course.

journeytomars
Автор

Thanks for the excellent tutorial Mark. successfully tested the deployment on the production server locally but, have some problem in the development, particularly in the " ", it gives me Permission denied error and was not mounted on the "/data/web", but when using " ", there is no error and can saved the media in "app/app/vol/static/media" and was not mounted in "/data/web/". anyway, the production deployment was great locally, haven't tested it yet in the actual production server, thanks Mark. keep it up.

miles