Deploying Django with Docker Compose

  Рет қаралды 86,303

London App Developer

London App Developer

Күн бұрын

How to deploy a Django app to an EC2 instance using Docker Compose.
Find the blog post for this tutorial here: londonappdeveloper.com/deploy...
Resources:
- uwsgi_params: uwsgi-docs.readthedocs.io/en/...
- Install Docker Compose: docs.docker.com/compose/install/
- GitHub SSH Guide: docs.github.com/en/enterprise...
- Finished Source Code: github.com/LondonAppDeveloper...
CHECK OUT OUR COURSES
➡️ DevOps Deployment Automation with Terraform, AWS and Docker: londonapp.dev/youtube-devops-aws
➡️ Deploy a Serverless Django app on Google App Engine: londonapp.dev/youtube-google-...
➡️ Build a Backend REST API with Python & Django - Advanced: londonapp.dev/youtube-django-...
➡️ Build a Backend REST API with Python & Django - Beginner: londonapp.dev/youtube-django-...
➡️ Python for Absolute Beginners: londonapp.dev/youtube-python-...
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:22:33 - Update settings.py file so that it pulls configuration values from environment variables
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:06:20 - Update settings.py to configure the locations that we created for 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

Пікірлер: 227
@solarsystem1958
@solarsystem1958 Жыл бұрын
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
@tomaszmakuch
@tomaszmakuch 2 жыл бұрын
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!
@lukeanglin263
@lukeanglin263 2 жыл бұрын
I am so thankful for your video Mark. You are an excellent, EXCELLENT teacher. One of the best tutorials for CS on KZbin for any subject! Keep up the wonderful work and I will be praying for your channel to grow even more!
@holgera7170
@holgera7170 2 жыл бұрын
Hey Mark, in my opinion one of the best tutorials on youtube. Thank u very much for your detailed explaination. This helped me a lot for our university project. kind greetings from germany
@gekare
@gekare Жыл бұрын
2.5 hours of pure information and experience. Thank you so much.
@LondonAppDeveloper
@LondonAppDeveloper Жыл бұрын
Thanks for the kind words, happy to hear it was useful.
@Yuyoukyu
@Yuyoukyu Жыл бұрын
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!❤
@LondonAppDeveloper
@LondonAppDeveloper Жыл бұрын
You're welcome. Thanks for watching and I'm happy you found it useful.
@RR-vi1oz
@RR-vi1oz 2 жыл бұрын
This is exactly what I have been looking for. I took your "Rest API" course on Udemy and learned a lot. Thanks again.
@pcslpaul
@pcslpaul 3 жыл бұрын
I’ve mashed the subscribe and like buttons! An excellent tutorial - I’ve been wondering about this topic for a while. I’ve learnt an enormous amount. If I get stuck with it I’ll either be doing the full course or contacting you direct for some consulting. Great work, thank you 👍
@realcodeninja
@realcodeninja 9 ай бұрын
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
@LondonAppDeveloper
@LondonAppDeveloper 9 ай бұрын
Thank you sir!
@sanjaydhande6573
@sanjaydhande6573 2 жыл бұрын
Ultimate explanation and the integration. Thanks for such excellent presentation and work.
@journeytomars4689
@journeytomars4689 2 жыл бұрын
Thanks for taking out time to create this tutorial. This video sooo good that I had to purchase the advanced course.
@ahmetkemalbabacan
@ahmetkemalbabacan 5 ай бұрын
Still perfect after two years. Great work! The best method I've ever seen about deploying the app to EC2.
@LondonAppDeveloper
@LondonAppDeveloper Ай бұрын
Thanks mate!
@youtalky_com
@youtalky_com 11 ай бұрын
Increadibly proffessional. Blog and the video itself. I am amazed. Thank you so much.
@joshuaochia7479
@joshuaochia7479 3 жыл бұрын
Been trying to find this!! thank you again Mark, you never cease to amaze me and be on the right time ahaahaha
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
That's fantastic, thank you :D
@Mrsubset
@Mrsubset 3 жыл бұрын
Uploaded at the right time. You're a Legend!
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Thank you! Glad it is useful.
@jeremyptlt
@jeremyptlt 2 жыл бұрын
This tutorial is amazing, thank you for the content!
@warshipwarriors
@warshipwarriors Жыл бұрын
Awesome tutorial. So many concepts clarified
@metalmlover
@metalmlover Ай бұрын
The best tutorial and instructor I've seen on the subject. really amazing
@LondonAppDeveloper
@LondonAppDeveloper Ай бұрын
Thank you!
@antoniomontero3987
@antoniomontero3987 2 жыл бұрын
Yo Mark! I purchased your advanced Django course on Udemy a couple of years ago and it's the best damn course on the subject. Perhaps the only thing missing was how to deploy the project to AWS using Docker containers, so thanks for this video! Keep up the good work, my dude.
@LondonAppDeveloper
@LondonAppDeveloper 2 жыл бұрын
Hey Antonio, thanks so much, really appreciate that. I'll keep your feedback in mind and hope to create content on it soon!
@sandeeps808
@sandeeps808 2 жыл бұрын
@@LondonAppDeveloper can i have the link to your udemy course?
@enricosaccheggiani3192
@enricosaccheggiani3192 3 жыл бұрын
very well explained the part of wsgi, nginx, static files . Very good
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Thanks so much!
@jasonoesch4652
@jasonoesch4652 11 ай бұрын
THIS. I can finally replace all my hacky docker workarounds and understand what I'm actually doing. Mark, you're the best
@LondonAppDeveloper
@LondonAppDeveloper Ай бұрын
Thanks mate, that's kind.
@user-ni4sq9td6l
@user-ni4sq9td6l Жыл бұрын
Thanks a lot for the lessons! you have the best content! I have a question, did we write the “migrate” command in the script, and in the case of development, do we have to execute the “makemigrations” command manually? Or can this one be automated as well? for example to register in “Dickerfile”?
@weeiwaai3517
@weeiwaai3517 2 жыл бұрын
Thank you for the detailed tutorial :) it helped!
@vinchuli8737
@vinchuli8737 Жыл бұрын
Thank you so much for such a wonderful explanation. Best tutorial
@threekingdoms99
@threekingdoms99 2 жыл бұрын
Thank you very much, Mark! It's very helpful!
@kayakwinana2133
@kayakwinana2133 Жыл бұрын
Very good tutorial! Hope you still take questions. I have only one issue confusing me and this relates to line 23 of the Dockerfile - the app:app. I assume the 2nd app is the added user. What does the first app refer to?
@tomha1
@tomha1 Жыл бұрын
this is a great video. so much useful stuff in it that it taken 5 sittings to complete and over a month
@tomha1
@tomha1 Жыл бұрын
just about completed this now :) Most recent working versions are: Dockerfile: python:3.11-alpine3.15 docker-compose.yml / docker-compose-deploy.yml - Python 3.11 - Image: postgres:15-alpine Requirements.txt: Django==4.2 psycopg2==2.9.6 uWSGI==2.0.21
@stevemulcahy5014
@stevemulcahy5014 10 ай бұрын
This is a great tutorial, so I definitely liked and subscribed. I'm not a fan of the deployment method (github actions would be nicer), but the way you configured docker for local django development and introducing env variables seems to be the best way I've seen, and I think the nginx container handling static is has its advantages over S3 for smaller sites. But that's the beauty of tutorials, you don't have to adopt everything exactly the same. I do have a couple of questions more down to Django development though: What I envision with Django for CMS kind of sites is that I want to develop a starting point with my core app locally, but have it so my pages (like "about" and "contact us" kind of pages) are built out without hard coding content, so I'd have a model in the core app called Page. The problem this introduces though is that a database migration won't populate the content from dev to prod. So I'd need a deployment step that backs up the local db and restores it to the prod db. Is this an approach you'd take, or would you try to leave database stored content as something that shouldn't be in each environment? My other question is down to the wait_for_db command. Is there a reason this is in an app rather than the actual project folder where the settings.py file is located?
@mediatwinkleTV
@mediatwinkleTV 3 жыл бұрын
This is what I'm talking about ! Thank you sir !
@reabstractor
@reabstractor 2 жыл бұрын
Totally fantastic video!!! Lot of thanks!
@ndifrekeumoren3548
@ndifrekeumoren3548 2 жыл бұрын
Thanks for this wonderful tutorial. I took your course on Django API using docker Udemy, lovely course, but it could use an update. Thanks once again
@isaackmata7235
@isaackmata7235 Жыл бұрын
How do you apply for that course brother
@isaackmata7235
@isaackmata7235 Жыл бұрын
How do you apply for that course brother
@alvaropicatoste2546
@alvaropicatoste2546 2 жыл бұрын
Great tutorial. Thanks for sharing.
@TheDragon573
@TheDragon573 Жыл бұрын
Brilliant tutorial! Thank you!
@aleksandarpetrovic2632
@aleksandarpetrovic2632 2 жыл бұрын
Tnx man for this amazing tutorial
@florasblancas9921
@florasblancas9921 3 жыл бұрын
Thank you for great tutorial!!
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
You're welcome, thank you for watching!
@Yuyoukyu
@Yuyoukyu Жыл бұрын
Thank you Mark! Appreciated for the video!
@LondonAppDeveloper
@LondonAppDeveloper Жыл бұрын
Hey Weihao, thanks so much, this is my first Super Thanks :D Really appreciate it.
@danmbalyo8685
@danmbalyo8685 Жыл бұрын
Hello Mark, thank you for this great course it is short and precise. I would like to request if you have a specific course on handling static files. I will greatly appreciate it.
@vinchuli8737
@vinchuli8737 Жыл бұрын
I LOVED IT YOU SAVED ME A WEEK
@ayencoscolfield3312
@ayencoscolfield3312 Жыл бұрын
Thanks man this was really nice👍
@enricosaccheggiani3192
@enricosaccheggiani3192 3 жыл бұрын
Thanks a lot. What i was waiting for
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Great! Let me know what you think.
@enricosaccheggiani3192
@enricosaccheggiani3192 3 жыл бұрын
@@LondonAppDeveloper thanks a lot in advance for this video. I have a complete django project to deploy with a e-commerce, models, and many IOt features . I have tried in many time to deploy but didn't work or worked only launching a runserver into a instance now i am following your tutorial to see whether it works on aws . Thanks for your interesting videos. All the best regards
@himansrivastava
@himansrivastava 2 жыл бұрын
Amazing tutorial!
@maxtibip
@maxtibip 9 ай бұрын
Thank you so much for this wonderful tutorial
@LondonAppDeveloper
@LondonAppDeveloper 9 ай бұрын
Thank you for watching!
@pkumarpl
@pkumarpl 2 жыл бұрын
Hi, very nice tutorial indeed. I have question regarding applying SSL Certificate on Nginx and expose to port 443. Do you have any working example?
@proyectolibronube6732
@proyectolibronube6732 Жыл бұрын
Thanks just suscribed!. Do you always lose the data in database when deploying? how can I make it so that i dont. Just starting and i will like to dockerize a project that is already deployed.
@martrom0
@martrom0 Жыл бұрын
Excellent ! Thanks a lot !
@MiRaje8086
@MiRaje8086 2 жыл бұрын
Thanks a lot for this, going to watch through it all and follow along this weekend
@JoeFrixon
@JoeFrixon 3 жыл бұрын
This tutorial is awesome,
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Thanks so much!
@rawgov
@rawgov 2 жыл бұрын
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
@danielsemerjyan513
@danielsemerjyan513 2 жыл бұрын
Thx
@olipack72
@olipack72 2 жыл бұрын
"sudo chmod -R a+rwx ./data" alone didn´t fix the issue in my case. I also had to change the ownership from ROOT to MY_USER by executing "sudo chown -R MY_USER:MY_USER ./data". Only then it worked!
@humbertocueva3815
@humbertocueva3815 Жыл бұрын
How can i access to the root folder from the terminal?
@rawgov
@rawgov Жыл бұрын
@@humbertocueva3815 just cd into the path where your project exists. Once you are inside the project folder that's what is called the root folder. Basically which ever folder the .data folder exists. If you're a newbie, then just open the project folder in vscode and select new terminal from the top menu and it will launch the terminal directly in the root folder of the project. From there you can directly enter the command. If it doesn't work just type ls -al and make sure that the .data folder exists within the folder you're in.
@inyo300
@inyo300 Жыл бұрын
I'm a pretty late, but I wanted to add to this to help future people figure out this problem for themselves. I'm using bash, and for me personally, only changing ownership was necessary . When django automatically creates the ./data/web/ path, the permission types for these directories were the same as all the other directories in the project folder, which for me is 755 (that's rwxr-xr-x for those unacquainted). You can check by "typing ls -al" from the project's root directory. The real problem is that the /data/web directories are given "root" permissions instead of user permissions (if so, it will be indicated by "root root" in the list instead of "[user] [user]" like eveything else. So I believe simply starting from the root folder and running "sudo chown -R [user]:[user] data/" (and only this) like in Oliver's post would be all that's necessary for most people, unless they have more restrictive permission types set up for their project directory. If the latter is the case, subsequently running "sudo chmod -R 775 /data" from the project's root directory will suffice. If security isn't a concern, you can just use Ragav Y's version of the chmod command in the original message to nuke it from orbit. I just wanted to add that the core issue is likely the owner of the directories, not the permission types, but your mileage may vary.
@jr_py_dev
@jr_py_dev 2 жыл бұрын
man this tuto is awesome, i wish u could mention how to change the config files to connect with an aws rds db instead of a dockerized one!
@alessandroscimone5463
@alessandroscimone5463 2 жыл бұрын
absolutely fantastic!! and I'm only at minute 43 !!!! gooooo
@davidprokes840
@davidprokes840 Жыл бұрын
Hi, first of all thank you for this great video! Second, I have a question regarding named volumes. static-data volume is populated by the app service, then this volume is used by the proxy service. Is the volume sourced by the app service and not by the proxy because the proxy depends on the app?
@LondonAppDeveloper
@LondonAppDeveloper Жыл бұрын
The volume is not necessarily sourced by either container. The volume is the volume, and it's shared with the two containers that need the data. Apologies if I misunderstood the question.
@webdevsumit8311
@webdevsumit8311 2 жыл бұрын
One of the best Video....
@matthewcorbett8637
@matthewcorbett8637 Жыл бұрын
Thank you thank you thank you !!!!! This has been great fun ! Had some trouble with the MEDIA_ROOT needing to be 'vol...' and not '/vol...' but aside from that smooth sailing :) Now I can make my best friend a webapp for Xmas !!
@LondonAppDeveloper
@LondonAppDeveloper Жыл бұрын
Great to hear! Hope your friend enjoys their Christmas web app.
@miles2590
@miles2590 2 жыл бұрын
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 " MEDIA_ROOT='/vol/static/media' ", it gives me Permission denied error and was not mounted on the "/data/web", but when using " MEDIA_ROOT='vol/static/media/' ", 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.
@nicolasqueiroga6455
@nicolasqueiroga6455 2 жыл бұрын
same problem here
@jorgeramiroalarconvargas2580
@jorgeramiroalarconvargas2580 2 жыл бұрын
@@nicolasqueiroga6455 maybe is this: When docker create a data/web to our system it creates with user roots permissions, so when Django app tries to save the file can't. so just change the permissions data/web file to your current user.
@auwalyahaya1938
@auwalyahaya1938 2 жыл бұрын
thank You very much for the class but I ran into a problem when running docker-compose build and here is response i got Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.') [9676] Failed to execute script docker-compose
@nidhinp353
@nidhinp353 2 жыл бұрын
this is a gem
@giundattimban
@giundattimban 2 жыл бұрын
could you help to make an example how to add SSL certs to nginx django uwsgi deploy with docker. thankyou so much
@pakoiliev
@pakoiliev Жыл бұрын
Great video !
@fernandosalazar5800
@fernandosalazar5800 3 жыл бұрын
i never write youtube comments but this tutorial was amazing. thank you
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Thanks mate so happy to hear that.
@fernandosalazar5800
@fernandosalazar5800 3 жыл бұрын
@@LondonAppDeveloper im trying to connect my react app to my EC2 instance but it fails to connect over HTTPS. It works perfectly fine over HTTP. Have been looking for solutions but failed miserably. Im not sure if the docker setup is the issue or not. Any recommendations on where to look?
@rawgov
@rawgov 2 жыл бұрын
I'm trying to deploy this to Heroku and I am stuck on this - Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch I know I'm supposed to get the port it's served on using an ENV variable that Heroku randomly assigns it, but my understanding of Nginx and docker isn't sufficient enough for me to figure out where to change what. Does anyone have experience with this?
@onyilimba
@onyilimba 11 ай бұрын
Will there be any need for the wait_for_db command if postgresql is defined before the app service? I don't really know docker but from the outputs it seems to run from top to bottom.
@setiawankarnata4693
@setiawankarnata4693 2 жыл бұрын
Hi Mark. Excellent videos tutorial. I tried following every step in your video but unfortunately i met error when i run command : docker-compose run --rm app sh -c "django-admin startproject app ." sh: django-admin: not found (Error : 127) I stop the tutorial since i have this issue. Please advise. Thank you.
@talha_anwar
@talha_anwar 2 жыл бұрын
thanks. can you please do ssl par?
@nooribrahim4012
@nooribrahim4012 2 жыл бұрын
Hi Mark! Please let me know how to do port mapping in order to scale up this website. You just worked on admin url, anything other url doesn’t work. It say thay “Not found”.
@Deeredman4
@Deeredman4 2 жыл бұрын
Can't figure out where to put css and js files... I know it has something to do with vol/web/static but I'm pretty stuck...
@veyselaksin
@veyselaksin 2 жыл бұрын
Did you find any way?
@elizabethramirez4133
@elizabethramirez4133 2 жыл бұрын
I am having trouble doing the docker compose build, because I have pandas on the requirements, do you happen to know how to solve it? I have been trying to solve it for the whole week and I can't find any solutions. Thank you!
@SugarrayCN24
@SugarrayCN24 Жыл бұрын
thanks for this! I am trying to get streaming request working but couldn't get it working (I tried using proxy_buffering off; in nginx conf). Could you show us how to tweak this to allow streaming request?
@isaachatilima
@isaachatilima Жыл бұрын
I am stuck making migrations. I have a Mac and use PostgreSQL. I want to use my local machine database, not a Docker image. I cannot connect to that DB. Any help?
@user-tm5gx9iu6q
@user-tm5gx9iu6q Жыл бұрын
Would you please do all this again but using latest version of Django 4. Thanks
@nooribrahim4012
@nooribrahim4012 2 жыл бұрын
Hello! You didn’t tell how to resolve the issue of Not found, that happened almost in the end of video. please let me know that how to do port mapping in docker-compose-deploy.yml, only admin endpoint is working. i want to extend this website by adding more different thing. please reply and help me with it
@DEEPESHSINGH10
@DEEPESHSINGH10 2 жыл бұрын
How can I add cron jobs in this docker? before docker I used Django-crontab
@user-jh5nl1cp4y
@user-jh5nl1cp4y 8 күн бұрын
Hi. Why do we need volume 'static-data' in app container (django app) when all of the media requests are served through NGINX? Thanks
@shaikbyte
@shaikbyte 3 жыл бұрын
Hey London App Developer. one day i will meet you in London
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Yeah that would be cool! I'm living on Isle of Dogs right now :D
@apythonprogrammer7877
@apythonprogrammer7877 2 жыл бұрын
Why do you recommend using alpine for python? I had so much trouble getting it set up and running correctly with the latest versions of Django and python (4.0.2 and 3.10.2, respectively) that I decided to build without it and it went so much more smoothly, albeit at a larger total size (1.3gb total)
@KelDG3
@KelDG3 2 жыл бұрын
AFAIK it's mainly because it's smaller
@media7588
@media7588 Жыл бұрын
Thanks you so much
@mehedeehassan4635
@mehedeehassan4635 2 жыл бұрын
you have an amazing capability of teaching ..A good voice .I bought your python rest api course at udemy. Do you have any plan to make a course on java spring boot?
@LondonAppDeveloper
@LondonAppDeveloper 2 жыл бұрын
Thanks so much Mehedee :D Unfortunately I've not had much experience with Java recently, so I might not be the best person to create content on that.
@edwardmaya3275
@edwardmaya3275 2 жыл бұрын
Can you tell about how to handle the "502 Bad Gateway nginx" error. server runs on a digital ocean droplet. I tried to access the server via droplets public ip
@ThukuWakogi
@ThukuWakogi 2 жыл бұрын
For some reason, the wait_for_db command is stuck in a loop even after postgres is available
@webdevsumit8311
@webdevsumit8311 2 жыл бұрын
Now, How can we set ssl certificate to that
@michel_clemer6819
@michel_clemer6819 Жыл бұрын
Amazing👏
@ZactarZero
@ZactarZero Жыл бұрын
how do you update the migrations in the db?
@jairajsahgal7101
@jairajsahgal7101 8 ай бұрын
Thank you
@mahmoudamr1794
@mahmoudamr1794 8 ай бұрын
why do need to build postgres-client? i just put the pyscog-binary in requirements.txt?
@LondonAppDeveloper
@LondonAppDeveloper 8 ай бұрын
psycopg2-binrary is not recommended for production as mentioned on their pip page: pypi.org/project/psycopg2-binary/ "The binary package is a practical choice for development and testing but in production it is advised to use the package built from sources.". If you need to install it directly for dev only then it's fine, but my philosophy is to use Docker to match both local dev/prod as closely as possible.
@swelanauguste6176
@swelanauguste6176 3 жыл бұрын
Thanks for the video, let me ask ,you said it not scalable, wouldn't Kubernetes or docker swam help with scalability?
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Yeah absolutely, however they aren't covered in this tutorial which is why I gave the warning of the drawback :D
@SachinGupta-dn7wt
@SachinGupta-dn7wt 2 жыл бұрын
Please make a similar video by using Daphne, ASGI & Nginx
@jedtrucker
@jedtrucker 2 жыл бұрын
And psycopg3
@fredriksundberg6105
@fredriksundberg6105 3 жыл бұрын
This would be even more enlighting when having a Frontend (react etc), Backend (django), DB (Postgres etc) and Proxy (Nginx).
@sariyanta
@sariyanta 2 жыл бұрын
If I remember correctly, there is a video about setting this all up (except Frontend) in this channel.
@bashali6958
@bashali6958 2 жыл бұрын
kzbin.info/door/3RtgbslbAvE-5FFBkSgpig I second that. Perhaps Angular frontend that uses the same docker-compose to make it more interesting.
@ironrose6
@ironrose6 Жыл бұрын
@@sariyanta This is that exact video. The other guy wanted mainly a frontend in addition to the other stuff already taught in this video.
@njirainidouglas
@njirainidouglas Жыл бұрын
i am getting an error PermissionError: [Errno 13] Permission denied: '/vol/web/static/admin' when doing collect static please help
@Frozienas
@Frozienas 3 жыл бұрын
Hello! Does DRF deployment have the same steps as this one?
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Yes
@liorbm1
@liorbm1 2 жыл бұрын
Why not using elastic beanstalk ?
@brunoresendesantos45
@brunoresendesantos45 3 жыл бұрын
Great tutorial. Could you point me how to enable SSL using this setup with Ngix?
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Great question. I'm going to make another tutorial about SSL. The way to do it is like this: 1) Procure SSL certificates, 2) Update NGINX config to add SSL support, 3) Update the Docker Compose config and security groups to allow access via port 443, 4) Add a volume to the NGINX service which maps the server directory containing the SSL certs to the directory NGINX is configured to find them. It would also be possible to use Let's encrypt by adding another service to the deployment docker compose which runs the agent that updates the certs. I expect this would involve mapping a volume for the certs and a volume for the refresh keys that I believe needs to be served via NGINX. I need to spend some time figuring it out myself before I create a guide on it :)
@brunoresendesantos45
@brunoresendesantos45 3 жыл бұрын
@@LondonAppDeveloper Thank you so much for taking the time to answer. I will give the first option a try. You have no idea how much value you are offering to the community!
@near5090
@near5090 2 жыл бұрын
hi were you be able to add ssl to this setup? and how you did it if yes?
@devendrasahu3470
@devendrasahu3470 Жыл бұрын
can you please help me to fix this issue :- PermissionError at /admin/core/sample/add/ [Errno 13] Permission denied: '/vol/web/media'
@lumsism
@lumsism 2 жыл бұрын
Thank you very much for this tutorial Mark. I suffered for more than 48 hours trying to solve the permission denied error. I had to add the line ```chown -R user:user /app``` to my Dockerfile to get rid of the error and finally fully deploy my app. I am trying to integrate SSL certificate i will report back on how it goes
@alexis3170
@alexis3170 2 жыл бұрын
Using similar setup as video, also trying to figure the SSL certificates out. any updates on that? cheers.
@nooribrahim4012
@nooribrahim4012 2 жыл бұрын
Hi mark! Please make video on Django channels and websockets
@LondonAppDeveloper
@LondonAppDeveloper 2 жыл бұрын
Not quite the same but we have a tutorial (albeit and old one) on our website: HOW TO BUILD A WEBSOCKET MULTI-CLIENT CHAT USING IONIC AND NODE.JS.
@canht95
@canht95 2 жыл бұрын
I had to set the owner of the /data to the UUID of the docker user during debugging manually to proceed. Did I skip a crucial step?
@LondonAppDeveloper
@LondonAppDeveloper 2 жыл бұрын
Hmm weird... Are you using Linux? Or running Docker using sudo?
@canht95
@canht95 2 жыл бұрын
@@LondonAppDeveloper yes, I am on Linux. Forgot to mention that my apologies
@robertkhakimov3262
@robertkhakimov3262 3 жыл бұрын
Awesome tutorial, I've watched it till the end and everything worked. But when I came back to this project after a week and tried to launch it didn't connect me to the website and throw err_connection_timed_out error in browser. I've checked and replaced host address with new one which was provided by ec2 (after relaunching instance). What could be wrong?
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Hey mate, could be that the ALLOWED_HOSTS needs to be changed? I didn't think it would re-assign a hostname after re-launch though.
@robertkhakimov3262
@robertkhakimov3262 3 жыл бұрын
​@@LondonAppDeveloper Thanks for the answer but I've already changed the ALLOWED_HOSTS variable via "vi .env", moreover I tried to use Elastic IP adress to keep IP adress during sessions but that didn't work. I've also tried to create another instance and deploy project there but still the same result... After a while there were some queries in the console but all of them were with "HTTP 400" and they weren't connected with my attempts to reach the website. I've spent a day and a half to find information but there was none.
@RuslanSkiraUkraine
@RuslanSkiraUkraine 2 жыл бұрын
@@robertkhakimov3262 any updates? I stuck on the same one. Locally, project is working. Bu on ES2 not.
@robertkhakimov3262
@robertkhakimov3262 2 жыл бұрын
​@@RuslanSkiraUkraine , I've solved it in a bit odd way. So when you open your ec2 instance in browser you can see the Public IPv4 address and Public IPv4 DNS with buttons "open address". I've always tried to open my website via these buttons but never succeeded (err_connection_timed_out). But then I just copied and pasted IPv4 and all of a sudden everything worked as usual. I think it's because when you press the button it opens website using https protocol but if you copy and paste the actual ip it will be opened with http. Hope this helps.
@RuslanSkiraUkraine
@RuslanSkiraUkraine 2 жыл бұрын
@@robertkhakimov3262 Thank you for the fast response. I was trying it. It doesn't help me.
@oybekyuldashov8269
@oybekyuldashov8269 11 ай бұрын
how to add SSL certificate
@pabloserra89
@pabloserra89 5 ай бұрын
Hello and, first of all, thanks for the tutorials. I was able to follow every step and I have an app working. But, I have a problem connecting with the postgres using pgAdmin (that is inside another container). I have install the pgAdmin using: docker pull dpage/pgadmin4 Have anyone had the same problem?
@adejoh6650
@adejoh6650 3 жыл бұрын
Can I do all the configuration above and run on AWS Lightsail??
@LondonAppDeveloper
@LondonAppDeveloper 3 жыл бұрын
Not used Lightsail myself but I think it's just like Digital Ocean (you buy a VM and get access to it?)... Answer is probably yes, but of course some of the steps will be different. Not sure if Lightsail gives the option to use the Amazon Linux 2 AMI? The project setup and deployment part should work the same.
@adejoh6650
@adejoh6650 3 жыл бұрын
@@LondonAppDeveloper will try it out... Thank You!!!
@donaldjunior1442
@donaldjunior1442 2 жыл бұрын
Just started watching this video but to be honest there isn't any tutorial that shows how to go from a compose file to AWS using ESC fargate.
@neetesshhr
@neetesshhr 2 жыл бұрын
db_1 | 2022-01-20 10:09:47.641 UTC [67] DETAIL: Password does not match for user "approotuser". db_1 | Connection matched pg_hba.conf line 99: "host all all all md5" db_1 | 2022-01-20 10:09:48.645 UTC [68] FATAL: password authentication failed for user "approotuser" db_1 | 2022-01-20 10:09:48.645 UTC [68] DETAIL: Password does not match for user "
@vicheanath9412
@vicheanath9412 2 жыл бұрын
I got the same issue i think docker-compose can't read .env file but i don't know how to fixed it.
Prepare a Django app for Deployment using Docker
39:10
London App Developer
Рет қаралды 87 М.
Building a Django Docker Container
34:11
Very Academy
Рет қаралды 20 М.
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 3,6 МЛН
How to bring sweets anywhere 😋🍰🍫
00:32
TooTool
Рет қаралды 44 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 8 МЛН
2000000❤️⚽️#shorts #thankyou
00:20
あしざるFC
Рет қаралды 15 МЛН
Kubernetes Architecture explained | Kubernetes Tutorial 15
13:08
TechWorld with Nana
Рет қаралды 236 М.
Django & Postgres with Docker Best Practices
11:11
Beyond Database
Рет қаралды 16 М.
The 4 best ways to deploy a Django application
7:01
London App Developer
Рет қаралды 114 М.
Deploying Django with Docker Compose, Gunicorn and Nginx
15:59
Django road
Рет қаралды 88 М.
Debugging a Dockerized Django app with VSCode
23:22
London App Developer
Рет қаралды 34 М.
Bash Scripting on Linux (The Complete Guide) Class 02 - Hello World
17:24
ТОП-5 культовых телефонов‼️
1:00
Pedant.ru
Рет қаралды 15 М.
Карточка Зарядка 📱 ( @ArshSoni )
0:23
EpicShortsRussia
Рет қаралды 788 М.
Настоящий детектор , который нужен каждому!
0:16
Ender Пересказы
Рет қаралды 345 М.
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 6 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 1,7 МЛН
WWDC 2024 - June 10 | Apple
1:43:37
Apple
Рет қаралды 10 МЛН