Code up everybody say, When you hear Paul call you’ve got to get it underway, Zander, it’s the code word No matter where you say it at very academy you know you will be heard! (Word up by Cameo)
Please take me as your discipline, Master! Thank you very much, I roam the whole internet world to find this explanation and your video has helped me a lot
Sir you are a godsend. I've spent the past month struggling through various forums and websites trying to decipher the mysterious world of Django and Docker web serving. Your series has truly saved me so much frustration. I appreciate you.
@@veryacademy yes please! I'm learning Django and React and I was intending to learn Docker for deployment. So this tutorial is exactly what I need :) Hope you create more tutorials like this
Searched through the web for React/DRF/nginx deployment tutorial on windows machine, your video has been the best fit and most helpful to me! Thank you for uploading this comprehensive video👏
Thanks, I will swing back over to this series soon. Nginx isn't my specialism but will get some ideas together to try and push this forward a bit. Think there is a good number of people who would like to see an Nginx series.
@@veryacademy Hey! First of all, thank you so much for all your efforts! You are helping so much to me! I would be even more grateful to you, if you could show and explain an example of a production level project that kind of brings together all the notions that you showed of "Docker Mastery with Django". I mean one project with Celery, PosgtreSQL, DRF, React.js, pgAmin -> All in one! And finally guide, how to deploy it on a server. Thank you again and again!
This is extremely helpful and extremely well put together. Thank you so much for providing such videos for free. Will there be a tutorial on how to take this setup and apply it onto a server in the cloud?
hi, thank you very much for this. however, cors seem not happy at all about this setup and systematically rejects fetching from the nginx server. should i add "localhost" to the cors policies in django core.settings ?
Hi, thanks very much for the tutorial! I encounter a problem when I used your final code. after I execute "docker-compose up", the react frontend will exit (exited with code 0), can you please help me with that?
Hey Very Academy! First of all, thank you for putting together this great tutorial (and hopefully rapidly complete series :D) So far, excellent work! I had a quick question regarding the Git Repo - I cloned the entire repo and was searching through - the section labeled Part 1 does not exactly match this tutorial, it seems that the directory inside 6 -> starting repository is most exactly the place where this tutorial starts, namely that there is both a Django file and React file. I'll follow this tutorial and use that directory, just wanted to ask about this as it might be confusing for some. Really excited for this series, such a useful thing to learn and at such a great time!
Hi Zander. I can't thank you enough regarding how much this video helped me. I just got one issue it seems like whenever I do changes to my react files the previous build persists. No matter rebuild or decaching I did doesn't work. Can you have a look and test if it does the same on your local? I've done some experiment and what works is if I manually delete the build folder inside the frontend container and then do a rebuild. It works but since I need to setup github actions this solution will never work for me.
Thank you so much for the video. I have a question related to production settings. What do I need to change when Debug is False? Because right now, when debug is false, nothing works. I would guess one needs to add to nginx directives for serving statics, and I tried that without success... I am wondering if it is supposed to work, just that the formating won't be nice? For me the backend doesn't work at all.
Hi , so now we can deploy this to our server , but we don't need to add our domain name to the nginx.conf file ? And by the way could you please tell me how would that setup be for a Django GraphQL and Next.js project ? Thank you I really appreciate the video !
First of all thank you for watching the tutorials so intently. That is one of the 2 big questions here - the other why try and make a react container in the first place - that is just for a visual learning purpose, all we need to do is build the react app locally and code the folder across to the nginx www folder. In short - the container has read only access to our conf file. Here we are making a bind between our conf file and the default conf - ./nginx/nginx-setup.conf:/etc/nginx/conf.d/default.conf with :ro (the text is not copied to the file for example) without :ro you will see the text from the our conf is copied across to the default.conf (remember the default.conf is the file that nginx is trying to read) if you like to have a look in the nginx terminal apt-get update apt-get install vim-tiny vi - etc/nginx/conf.d/default.conf
Would love to Jason, it is a topic that desperately needs more tutorials. I have my hands full at the moment, but I would be excited to start at some point.
Thank you for a great tutorial, Can you make one going a little bit further about adding django static and media files for development and production with docker and maybe explain about the permissions for different users through out docker, i was practicing and couldn't figure out how they work for example in development the images dont upload and get permission denied but the new user have permissions to the folder and so on...
@@veryacademy can you please add cpanel deployment too, i have been using it for quite long time for deployment its easy to work but the only problem is using it with integrated git system to deploy it every time automatically. Can ya consider this one too
It would be nice if you create a docker-compose video for nextjs + django cause there is not any tutorial for this on the web . Nextjs needs the API to be run on it's build process and this is the challenging part (django DRF must be running before nextjs build) .
Thank you for your very informative tutorial, it was very helpful, I kind of new to nginx and I want to run an application with django and vuejs but I want to also use celery and redis for my asynch tasks...can you explain to me how can I dockerize all of this together?
Great tutorial, thanks! I have to deploy the same web-server (backend on django and frontend on react), but using ubuntu. Will be the steps to do it the same as in your guide?
I noticed that the django admin does not show up correctly when using this setup with gunicorn. It appears the static files are missing. What would be the right approach to also deploy the django static files ?
Hi Wadii. You have a number of options. For example - do you want to even host your admin on your production site - seems like a good idea to run the admin somewhere else. Else maybe host via AWS or it shouldn't be too difficult to just configure in the settings - static files.
I solved the issue. I had to use -.django:/django for the nginx volumes, which maps my local django dir to the same on the nginx container, otherwise, the nginx container does not have any static files. Seems my original volume setup was not doing what it was supposed to - not sure why. I also added autoindex on; in the nginx conf: location /static/ { autoindex on; alias /django/static/; } This seems to work, but as you mentioned, may not be the best approach. Time to learn about cdn.
One question, There is this Nginx Error with the docker-compose.yml it returns, "/nginx/nginx-setup.conf" to rootfs at "/etc/nginx/conf.d/default.conf" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)?" how do we fix this??? I've been trying to figure this out for 3 days now
There are a crazy amount of reasons why this is. It is difficult to suggest, you probably have already been through stack overflow. Is this a problem you are experiencing with the code in the repository? If so what os and docker version you using? stackoverflow.com/questions/45972812/are-you-trying-to-mount-a-directory-onto-a-file-or-vice-versa
Thank you for the great content! I'm new to react and nodejs. Quick question. Is it enough to just copy over the src, public, and node_modules/.bin folders along with the usual package jsons, to serve webpages? I've added this adjustment to my deployments and there is quite some time savings not having to copy the zillions of things inside the node_modules folder. Is there a limitation to this though? Or can I use this "optimization" in future deployments without worry?
Quick question: How is the port routing done to connect to a local mysql db form the django container? I had to create my database in AWS (mysql) and change the db django settings to get my app working.
Are you not possible to teach me how to deploy this app to Heroku? I have been watched your video " Django on docker to Heorku " and "Django and react on local to Heroku".
Hi Txcing. I have not made a tutorial so far on deploying Django with React. My focus is currently on the ORM content. I will no doubt be making some more tutorials on deployment in the future. Give this a go dev.to/mdrhmn/deploying-react-django-app-using-heroku-2gfa
Very good and educative video. Thank you very much for doing this. Although seems like in linux the method is different I think because for some reason my localhost:8000/api/ is having problems with the static files. It's trying to load files in/static/rest_framework but every file responses with "Page not found (404)" even though debug=True, kinda strange.
thank you for this very helpful video, I have one small issue when I change some content in my react app these changes not happened even I restart the container
Hello thanks for the tutorial. I'm facing this issue info: can not modify /etc/nginx/conf.d/default.conf (read-only file system?) Any help will be appreciable.
First of all thank you very much for your valuable tutorials, they are great. I have a question, how would you configure a project where Django (rest framework) is an indepandant API (let's say in Heroku) and consumed by an independant React app (let's say in netlify) using Axios ,how would you approach this with Nginx (to be able to display images, nothing fancy just statics), i tried and failed miserably to get images to display, again thank you
I don't believe that the diagram at 16:16 is saying that "volume" stores in memory I think it's saying that "volume" stores in "Docker area" I think it's saying that "tmpfs mount" is storing in memory.
I am facing "standard_init_linux.go:219: exec user process caused: no such file or directory " while trying to run docker-compose in django project, could you please provide some pointers for resolving this
Wow! Thank you for this awesome tutorial! Liked and Subscribed! :) Can you also do a video on deploying this app in AWS using the same dockerized containers approach? Can you do in 2 parts? 1. All in one ec2 instance 2. Separate servers - Django app server in it's own ec2 instance - Database on a separate instance - Static files and media files on s3 bucket - React server in it's own ec2 instance - and how can you hook them up together in an nginx server? Thanks in advanced!
I will most definitely be moving onto the content you suggested. I am working on some Nginx tutorials this week, this will be the start of us moving forward to deployment
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 1: FROM requires either one or three arguments Service 'backend' failed to build : Build failed
stackoverflow.com/questions/62388139/dockerfile-parse-error-line-1-from-requires-either-one-or-three-arguments-but it could be something crazy like this
When I find myself in coding troubles,
Very Academy comes to me,
Speaking words of wisdom,
Code with me!
Code up everybody say,
When you hear Paul call you’ve got to get it underway,
Zander, it’s the code word
No matter where you say it at very academy you know you will be heard! (Word up by Cameo)
Please take me as your discipline, Master! Thank you very much, I roam the whole internet world to find this explanation and your video has helped me a lot
In awe for having all this invaluable content for free. Thanks Zander! When I get a job I'll join the community!
Thank you kindly!
Sir you are a godsend. I've spent the past month struggling through various forums and websites trying to decipher the mysterious world of Django and Docker web serving. Your series has truly saved me so much frustration. I appreciate you.
This is definitely a very welcome video, Zander! Deployment is often neglected in courses or treated lightly. Really appreciate this one!
Glad it was helpful! Will work towards a full deploy template
@@veryacademy yes please!
I'm learning Django and React and I was intending to learn Docker for deployment. So this tutorial is exactly what I need :)
Hope you create more tutorials like this
@@veryacademy very informative video. thank you. Have you made a video for final deployment?
Thanks!
The content in the video deserve more likes and view..
Searched through the web for React/DRF/nginx deployment tutorial on windows machine, your video has been the best fit and most helpful to me! Thank you for uploading this comprehensive video👏
Hi, glad it was useful. Let me know if there is something missing or any other tutorial suggestions.
thank you so much for all this zander!!! best teacher alive!
You're very welcome!
Zander thanks a lot for sharing with us all that knowledge its absolutely fantastic !!!!
Glad you enjoyed it!
Wow, amazing tutorial! Couldn't have been better and it deserves more likes.
Definetly!
you saved all my nerves, thank you so much, everything is so clear and it works
Your are doing very good job...love from india ...keep uploading
Thank you so much 😀
Woowww!!!!! It worked just perfect! Thanks a lot for the easy explanation.
Thank for sharing these professional methods, go further
Thanks, I will swing back over to this series soon. Nginx isn't my specialism but will get some ideas together to try and push this forward a bit. Think there is a good number of people who would like to see an Nginx series.
Content is king. Thank you Zander. 🙏
Excellent stuff. I followed everything through and it all work perfectly. Now to add some enhancements! ;) Really hoping you continue this series.
Thanks James, meaning to get this all deployed next. It is an endless series really. Any suggestions what you would like to see next?
@@veryacademy Hey! First of all, thank you so much for all your efforts! You are helping so much to me! I would be even more grateful to you, if you could show and explain an example of a production level project that kind of brings together all the notions that you showed of "Docker Mastery with Django". I mean one project with Celery, PosgtreSQL, DRF, React.js, pgAmin -> All in one! And finally guide, how to deploy it on a server. Thank you again and again!
wow! that's a great tutorial! thank you very much for taking time to do it. it is very clear and useful! thank you!
Thank you, I have an interesting Django nginx cache tutorial coming up soon
Thanks it helped me a lot. Amazing Tutorial
Glad it helped!
This guide was perfect. thank you so much! It is exactly what I was looking for
Great Tutorial.
Thank you for all your hard work, keep it up 😀
Thank you!
Very informative vid. Thanks
Awseome this helped lots, Thank you
You're welcome!
You're so amazing dude, I really needed this video
Glad I could help!
Thanks for this wonderful tutorial
What a great tutorial!
thank you very much !
Glad it helped!
Thanks for all the good videos.
This is extremely helpful and extremely well put together. Thank you so much for providing such videos for free.
Will there be a tutorial on how to take this setup and apply it onto a server in the cloud?
Ty man , it's very important info for beginners
👍
Thank you very much sir 👌👏👏👏
Awesome as always 👍😀
Thanks again!
can you do a video where you deploy this in a real server like redhat or centos? what docker compose file would you use?
Amazing Video --- helped us too much
Thank you very much appreciated
You are very welcome
I really do appreciate this video, every step was easy to follow along with. Perhaps an extension would be to manage django static files?
very very helpful video
Glad to hear that
thank you sir it was very helpfull
🇪🇹thanks for the amazing video. found it very useful 👍
hi, thank you very much for this. however, cors seem not happy at all about this setup and systematically rejects fetching from the nginx server. should i add "localhost" to the cors policies in django core.settings ?
Hi, thanks very much for the tutorial! I encounter a problem when I used your final code.
after I execute "docker-compose up", the react frontend will exit (exited with code 0), can you please help me with that?
Awsesome explanation!
Hey Very Academy! First of all, thank you for putting together this great tutorial (and hopefully rapidly complete series :D) So far, excellent work!
I had a quick question regarding the Git Repo - I cloned the entire repo and was searching through - the section labeled Part 1 does not exactly match this tutorial, it seems that the directory inside 6 -> starting repository is most exactly the place where this tutorial starts, namely that there is both a Django file and React file. I'll follow this tutorial and use that directory, just wanted to ask about this as it might be confusing for some.
Really excited for this series, such a useful thing to learn and at such a great time!
Hi Zander. I can't thank you enough regarding how much this video helped me. I just got one issue it seems like whenever I do changes to my react files the previous build persists. No matter rebuild or decaching I did doesn't work. Can you have a look and test if it does the same on your local? I've done some experiment and what works is if I manually delete the build folder inside the frontend container and then do a rebuild. It works but since I need to setup github actions this solution will never work for me.
Thank you so much for the video.
I have a question related to production settings.
What do I need to change when Debug is False? Because right now, when debug is false, nothing works. I would guess one needs to add to nginx directives for serving statics, and I tried that without success...
I am wondering if it is supposed to work, just that the formating won't be nice? For me the backend doesn't work at all.
THis is awesome
First! Awesome content as usual
👍
Hi , so now we can deploy this to our server , but we don't need to add our domain name to the nginx.conf file ? And by the way could you please tell me how would that setup be for a Django GraphQL and Next.js project ? Thank you I really appreciate the video !
Hey, lots to do! This was just an intro into this area which turns out to be very popular. Much to do, I will follow this up eventually.
@@veryacademy i see , at least could you tell me how can i setup the dockerfile and docker-compose.yml for Next.js ?
23:25 can you explain what this last parameter :ro is for?
First of all thank you for watching the tutorials so intently. That is one of the 2 big questions here - the other why try and make a react container in the first place - that is just for a visual learning purpose, all we need to do is build the react app locally and code the folder across to the nginx www folder.
In short - the container has read only access to our conf file.
Here we are making a bind between our conf file and the default conf
- ./nginx/nginx-setup.conf:/etc/nginx/conf.d/default.conf
with :ro (the text is not copied to the file for example)
without :ro you will see the text from the our conf is copied across to the default.conf (remember the default.conf is the file that nginx is trying to read)
if you like to have a look in the nginx terminal
apt-get update
apt-get install vim-tiny
vi - etc/nginx/conf.d/default.conf
Can please you make a series or a video about nginx?
Would love to Jason, it is a topic that desperately needs more tutorials. I have my hands full at the moment, but I would be excited to start at some point.
Thank you for a great tutorial,
Can you make one going a little bit further about adding django static and media files for development and production with docker and maybe explain about the permissions for different users through out docker, i was practicing and couldn't figure out how they work for example in development the images dont upload and get permission denied but the new user have permissions to the folder and so on...
can you make a video about deploying the django project with dockerized on a server or a vps?
Yep, will do an updated Heroku and then Digital Ocean
@@veryacademy can you please add cpanel deployment too, i have been using it for quite long time for deployment its easy to work but the only problem is using it with integrated git system to deploy it every time automatically. Can ya consider this one too
This is great. Thank you. I have a query though....after running docker compose up I get the error no module named core.
It would be nice if you create a docker-compose video for nextjs + django cause there is not any tutorial for this on the web . Nextjs needs the API to be run on it's build process and this is the challenging part (django DRF must be running before nextjs build) .
Will you show, how to deploy this kind of app?
Sure, that's coming, we are building towards that.
thanks sir, may i ask why a volume was not created for the django backend?
Thank you for your very informative tutorial, it was very helpful, I kind of new to nginx and I want to run an application with django and vuejs but I want to also use celery and redis for my asynch tasks...can you explain to me how can I dockerize all of this together?
Great tutorial, thanks! I have to deploy the same web-server (backend on django and frontend on react), but using ubuntu. Will be the steps to do it the same as in your guide?
was i only, who got this is error: can not modify /etc/nginx/conf.d/default.conf (read-only file system?)
Any particualar reason build files form React are on a volume and not just inside the container?
no reason - just mixing it up
Does the volume map your local build output to the container? Or is it the build output of what's run inside the container?
I noticed that the django admin does not show up correctly when using this setup with gunicorn. It appears the static files are missing. What would be the right approach to also deploy the django static files ?
Hi Wadii. You have a number of options. For example - do you want to even host your admin on your production site - seems like a good idea to run the admin somewhere else. Else maybe host via AWS or it shouldn't be too difficult to just configure in the settings - static files.
I solved the issue. I had to use -.django:/django for the nginx volumes, which maps my local django dir to the same on the nginx container, otherwise, the nginx container does not have any static files. Seems my original volume setup was not doing what it was supposed to - not sure why. I also added autoindex on; in the nginx conf:
location /static/ {
autoindex on;
alias /django/static/;
}
This seems to work, but as you mentioned, may not be the best approach. Time to learn about cdn.
One question,
There is this Nginx Error with the docker-compose.yml
it returns,
"/nginx/nginx-setup.conf" to rootfs at "/etc/nginx/conf.d/default.conf" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)?"
how do we fix this??? I've been trying to figure this out for 3 days now
There are a crazy amount of reasons why this is. It is difficult to suggest, you probably have already been through stack overflow.
Is this a problem you are experiencing with the code in the repository? If so what os and docker version you using?
stackoverflow.com/questions/45972812/are-you-trying-to-mount-a-directory-onto-a-file-or-vice-versa
@@veryacademy Thank you for replying. For some reason wsl version was set to 1, and setting it to 2 solved everything. Thank you once again
Thank you for the great content! I'm new to react and nodejs. Quick question. Is it enough to just copy over the src, public, and node_modules/.bin folders along with the usual package jsons, to serve webpages? I've added this adjustment to my deployments and there is quite some time savings not having to copy the zillions of things inside the node_modules folder. Is there a limitation to this though? Or can I use this "optimization" in future deployments without worry?
You don't need to copy over the node_modules - just rebuild it on the server?
Indeed! I played around and noticed this a while after writing my question. I don't need the modules folder at all! Cheers!
Quick question: How is the port routing done to connect to a local mysql db form the django container?
I had to create my database in AWS (mysql) and change the db django settings to get my app working.
Hi Sam, did you answer your question?
Are you not possible to teach me how to deploy this app to Heroku? I have been watched your video " Django on docker to Heorku " and "Django and react on local to Heroku".
Hi Txcing. I have not made a tutorial so far on deploying Django with React. My focus is currently on the ORM content. I will no doubt be making some more tutorials on deployment in the future.
Give this a go
dev.to/mdrhmn/deploying-react-django-app-using-heroku-2gfa
Hi, Thank you!!! I dockerize my app in this way and it cannot hot reload. Could I know is it an issue with this method or I did something wrong?
Very good and educative video. Thank you very much for doing this.
Although seems like in linux the method is different I think because for some reason my localhost:8000/api/ is having problems with the static files. It's trying to load files in/static/rest_framework but every file responses with "Page not found (404)" even though debug=True, kinda strange.
Great work, please do quick review on django 3.2 UPDATE
Hi Oauth, there isn't really much to talk about to be honest. By the time I made it you could read it 10 times. 😂
🤣You're a legend!
For configuring SSL/TLS from this setup in docker, what would be the best practice?
thank you for this very helpful video, I have one small issue when I change some content in my react app these changes not happened even I restart the container
Hello. Try to delete the volume and restart the container
Nice
Unrelated question: what theme is that?
Hello thanks for the tutorial.
I'm facing this issue info: can not modify /etc/nginx/conf.d/default.conf (read-only file system?)
Any help will be appreciable.
nginx is not running as root user?
First of all thank you very much for your valuable tutorials, they are great. I have a question, how would you configure a project where Django (rest framework) is an indepandant API (let's say in Heroku) and consumed by an independant React app (let's say in netlify) using Axios ,how would you approach this with Nginx (to be able to display images, nothing fancy just statics), i tried and failed miserably to get images to display, again thank you
Hey where are you planning to run this nginx server on heroku?
I don't believe that the diagram at 16:16 is saying that "volume" stores in memory I think it's saying that "volume" stores in "Docker area" I think it's saying that "tmpfs mount" is storing in memory.
Please do serverless django google cloud deployment
I am facing "standard_init_linux.go:219: exec user process caused: no such file or directory " while trying to run docker-compose in django project, could you please provide some pointers for resolving this
Hello. How do I deploy this on Azure using postgres as the database?
Thanks for the suggestion
Why are you so useful lol
Unable to find the react/django setup codes used in this tutorial
You and me both! Sorry. Just ask ChatGPT for an example
Hi! great example, what's proxy_set_header Host $http_host? in ngnix-config. Thanks!
have a look here and get back to me if you still need help docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
Wow! Thank you for this awesome tutorial!
Liked and Subscribed! :)
Can you also do a video on deploying this app in AWS using the same dockerized containers approach?
Can you do in 2 parts?
1. All in one ec2 instance
2. Separate servers
- Django app server in it's own ec2 instance
- Database on a separate instance
- Static files and media files on s3 bucket
- React server in it's own ec2 instance
- and how can you hook them up together in an nginx server?
Thanks in advanced!
I will most definitely be moving onto the content you suggested. I am working on some Nginx tutorials this week, this will be the start of us moving forward to deployment
@@veryacademy wow, thank you so much! This is much appreciated. Looking forward to the series. God bless you and your channel!
How to deploy in digitalOcean?
What would you like to deploy exactly?
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 1: FROM requires either one or three arguments
Service 'backend' failed to build : Build failed
Hi, sorry I was out answering your question in the car. Will take another look.
FROM node:15.13-alpine
WORKDIR /react
COPY . .
RUN npm run build
Is it 15.13.0-alpine
@@veryacademy didnt work the same error
its node v 16.15.0
tried that; it isnt working either
stackoverflow.com/questions/62388139/dockerfile-parse-error-line-1-from-requires-either-one-or-three-arguments-but
it could be something crazy like this
@@veryacademy didnt work