Тёмный

Docker Compose | Build and start a Django project with Docker Compose & work in a Docker Container 

Very Academy
Подписаться 67 тыс.
Просмотров 51 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 84   
@matheusandrade1059
@matheusandrade1059 8 месяцев назад
you are truly a life savior, you have no idea. Great video, clear and simple explanation thank you so much
@veryacademy
@veryacademy 8 месяцев назад
Glad it helped!
@teresa5832ify
@teresa5832ify 2 года назад
Big thank to this tutorial. I can finally understand every line in both dockerfile and docker compose. Other youtube videos I've watched don't go that detailed and clear. Thank you so much!!
@shaheerzaman620
@shaheerzaman620 3 года назад
so clear. Complexity simplified. Absolutely fantastic!
@veryacademy
@veryacademy 3 года назад
Glad it helped!
@mediatwinkleTV
@mediatwinkleTV 3 года назад
Sir, you are really really good at teaching. I mean really good. Of all the youtube videos I watch (and I watch a lot), you're in my top 3 youtuber on tech tools ! Thank you sir !
@veryacademy
@veryacademy 3 года назад
Thank you kindly! Who is the other 2?
@shreyashsrivastava5467
@shreyashsrivastava5467 3 года назад
I requested for this like just last day and you uploaded it today. Thank you so much ❤️
@veryacademy
@veryacademy 3 года назад
No problems, sorry I may have said it was tutorial 3 - this way seems a little more logical.
@catta6449
@catta6449 2 года назад
i've wathced so many tutorials, now i finally understand. sincerely, many many thanks to you.
@bumblebee2012able
@bumblebee2012able 3 года назад
Thanks from Vietnam, amazing as always
@veryacademy
@veryacademy 3 года назад
No problems! 👍
@felixfigueroa
@felixfigueroa 3 года назад
Clean and direct content, very focused, good job..!
@veryacademy
@veryacademy 3 года назад
Hi Felix, thanks for the support. Glad the content is of some use to you! 👍
@mohankrishna1443
@mohankrishna1443 8 месяцев назад
🙇 I bow my head sir! this Tutorial helped me a lot.
@veryacademy
@veryacademy 8 месяцев назад
Thank you.
@jmpersic
@jmpersic 2 года назад
Best tutorial I've found so far.
@TheAlibigdeli
@TheAlibigdeli 3 года назад
thank you for your awesome tutorials around the django framework
@veryacademy
@veryacademy 3 года назад
You are welcome!
@KuriakoseKuruvilaAnathanam
@KuriakoseKuruvilaAnathanam 8 месяцев назад
Incredibly informative tutorial.
@veryacademy
@veryacademy 8 месяцев назад
Glad you liked it
@akhillshetty2140
@akhillshetty2140 3 года назад
You're doing a great job, Zander!
@veryacademy
@veryacademy 3 года назад
I try - this is just one of those - no one has really made tutorials 👍
@mohankrishna1443
@mohankrishna1443 8 месяцев назад
This is just awesome
@LifeOf97
@LifeOf97 2 года назад
This is really easy to understand, thanks Very Academy.
@Morgan035
@Morgan035 Год назад
Thanks you very helpful
@veryacademy
@veryacademy Год назад
You're welcome!
@hassanelabdallah5013
@hassanelabdallah5013 3 года назад
best teacher ever👌🏻😉
@veryacademy
@veryacademy 3 года назад
Thank you! 😃
@archienemigo
@archienemigo Год назад
lov ya man you nailed it
@txcing9296
@txcing9296 2 года назад
you are amazing. thank you so much
@veryacademy
@veryacademy 2 года назад
Thank you 🙏
@AshisRaj
@AshisRaj 2 года назад
Excellent job buddy. You have cleared all my doubts. Thank you so much.
@dodokwak
@dodokwak 2 года назад
Yes, it was very useful. Thanks again.
@romainbey
@romainbey 3 года назад
Thanks for sharing this. Very good explanation.
@RABWA333
@RABWA333 3 года назад
Thank you very much , its very informative , helpful
@berkefekeskin9172
@berkefekeskin9172 3 месяца назад
i love docker
@naheliegend5222
@naheliegend5222 3 года назад
Thank you. Can you do videos about deploy to production?
@veryacademy
@veryacademy 3 года назад
I keep saying I will but not delivered yet, I definitely will do! I will find time for it soon! Promise!
@naheliegend5222
@naheliegend5222 3 года назад
@@veryacademy appreciate it a lot
@CookingInvitation
@CookingInvitation 3 года назад
I love your docker series and others, but I have a problem, I hope you can guide us on that as well. I am new to Docker, checked some tutorials for the understanding, but unfortunatelly I am not understanding one thing and that is: 1- How to use the Docker image with the prespective of development? I understand that we can make the docker image and push that to docker-hub repository, but don’t what to do after that. I pulled the docker image from docker-hub which I pushed. At this point I am missing what can I do with this image and how to do that? For Example: 1- Created a Django app 2- Created a Dockerfile 3- Created the docker-compose.yml file 4- Build the docker image with “docker-compose build” (on Windows 10) 5- Ran the image with “docker-compose up”. 6- Up until this point, everything went well and I can access the application from my browser. 7- Then I pushed this image to docker-hub and I can see the pushed image on the repository. 8- At this point I pulled the code at another machine that is running Ubuntu 20.04 and tried to run the docker. (no output) 9- Now I am confused here, what should I do with this docker image which I pulled from docker-hub? Where is my source code of Django App? How can I work etc. I am new to docker, please help. Thanks.
@veryacademy
@veryacademy 3 года назад
Will answer in the morning 👍
@muhammad-bilal1
@muhammad-bilal1 3 года назад
@@veryacademy waiting for your kind attention please.
@rayon9353
@rayon9353 2 года назад
@@veryacademy where did you answer this kind sir?
@CristianGomez-vc8pk
@CristianGomez-vc8pk 3 года назад
wonderful tutorial thank you so much
@md.moktarali1493
@md.moktarali1493 2 года назад
Really nice tutorial, thanks a lot
@rawannassan8162
@rawannassan8162 3 года назад
Great, Thank you sooo much
@veryacademy
@veryacademy 3 года назад
You're most welcome
@MrHasenboerga
@MrHasenboerga 8 месяцев назад
Hi, thanks a lot for this tutorial! You explain it in a great way. There is one point I did't get. Why should I run the "docker-compose run --rm app django-admin startproject core." command? Why not without docker-compose like in Part 1? The content of the folder will by copied to the container anyway, isn' it?
@veryacademy
@veryacademy 8 месяцев назад
Let me know if this doesn't make sense. The docker-compose run --rm app django-admin startproject core. command is used with Docker Compose to run a one-off command inside a service. This command is specifically designed for situations where you want to run a command in a Docker container defined in your docker-compose.yml file. The purpose of using docker-compose run in this context is to ensure that the command (django-admin startproject core.) is executed within the context of your Docker container. This ensures that the project structure and files created by the startproject command are within the Docker container and not on your local machine. If you were to run the django-admin startproject core. command directly on your local machine without docker-compose, the project structure and files would be created on your local machine, outside the Docker container. This might lead to compatibility issues, especially if your development environment relies on dependencies, configurations, or tools that are specific to the Docker container. By using docker-compose run --rm app, you explicitly specify the service (app in this case) where the command should be executed. The --rm flag ensures that the container is removed after the command completes.
@MrHasenboerga
@MrHasenboerga 8 месяцев назад
Thanks a lot for that very detailed answer. I’m quite new to Django and Docker. Your answers makes totally sense if I imagine that the django-admin command does slightly different things, if I runs inside or outside the container.
@imranshaikh6224
@imranshaikh6224 2 года назад
Awesome sir, but my question is how to run multiple commands for existing project like makemigrations, migrate, runserver for existing project please answer
@cje8887
@cje8887 3 года назад
I have the same problem as some others in this comment section: when i run `docker-compose run --rm app django-admin startproject core .` the django project doesn't get created. I am on MacOS and have tried it both with and without venv. EDIT: I had not saved some files in VSCode. Once I did file => save all and ran build and run again, it worked.
@veryacademy
@veryacademy 3 года назад
👍
@yashasbharadwaj4721
@yashasbharadwaj4721 3 года назад
tq so much sir really amazing
@khuramjaved450
@khuramjaved450 2 года назад
Hi, Thank you so much for the such complete explantory video. I have run the app successfully but facing another issue. When ever I try to use a class from Django or DRF, vscode can't auto import or show the option to import that class from django/drf module. This is really annoying after setting up the project. Kindly create a video on this issue or if there is already a video please send the link Thanks :-)
@codewithfarhad8594
@codewithfarhad8594 Год назад
to all those getting no file generated after running docker compose run, this is because the Dockerfile specifies working directory to be "/app" whereas, docker-compose.yml file specifies the working dir to be "/django". so it does not work. the easy fix is to edit your docker-compose.yml file and change the volume to mount in /app dir: - .:/app
@AndreBeeDXB
@AndreBeeDXB 3 года назад
Hi and thanks a lot for yet another amazing tutorial! One question if I might, why are we specifying the command to create a new Django "core" App on the CLI with the docker-compose run command and we are not placing it in the command: line inside the docker-compose.yml file? Couldn't we chain this command and the run server command there and avoid passing it manually? Thanks!
@GoziePO
@GoziePO Год назад
i had the issue where $docker-compose run --rm app django-admin startproject core . didn't work to create a core folder! I fixed it by changing the working directory in the docker file from /app to /django. You have to delete the container image in docker before trying the command again! hope this helps.
@brunomachado8571
@brunomachado8571 2 года назад
Hey Mate, best tutorials ever I might say. But I do get "Run a one-off command on a service." when running docker-compose build. It doesn´t create core . Any ideias why? thanks
@GoziePO
@GoziePO Год назад
i had the same issue but fixed it by changing the working directory in the docer file from /app to /django. You have to delete the container image in docker before trying the command again! hope this helps.
@bastianjohannesen1066
@bastianjohannesen1066 Год назад
Hi Which wsgi module is best suited for windows? I understand that uwsgi doesn't work?
@veryacademy
@veryacademy Год назад
Thanks for asking. I can’t help you there.
@mitmc6758
@mitmc6758 3 года назад
Thank you for good lesson. As I follow your lecture, I have some trouble with starting a django project. I can't see the "core" forlder created after the following command. I also don't see any error message. [docker-compose run --rm app django-admin startproject core . ] Could you give me some advice on that?
@gouravbansal994
@gouravbansal994 3 года назад
Are you using WSL2 in windows to run docker?
@veryacademy
@veryacademy 3 года назад
Yes 👍
@gflorin7761
@gflorin7761 Год назад
Hi! Do you still need to "COPY requirements.txt requirements.txt" if the "." directory is already mounted on "/django" on the container?
@fahadmdkamal530
@fahadmdkamal530 2 года назад
Cannot add or modify files of the generated file using linux ubuntu. It says: permission denied
@Conormcnproductions
@Conormcnproductions 2 года назад
is it possible to avoid using runserver on windows? what if you use WSL and download a linux app on windows, then you could download uswgi and other libraries that aren't available on windows. I don't understand enough to know what's possible on windows or what limitations there are
@bien-aimedimitri6450
@bien-aimedimitri6450 Год назад
Hi, my core app have the root permission how can i fix that
@ayeshrodrigo2197
@ayeshrodrigo2197 3 года назад
the new app "core" does not generate after running the command "docker-compose run ---rm app django-admin startproject core .". Any idea for the reason?
@veryacademy
@veryacademy 3 года назад
If you can paste in your docker file and docker compose file I will take a look
@ayeshrodrigo2197
@ayeshrodrigo2197 3 года назад
​@@veryacademy Found it. Seems it causes because my project was on a removable drive and it seems to require the project to be on the hard drive. Not sure why though, but it worked when the files moved to the hard drive folder and then run after a docker prune.
@veryacademy
@veryacademy 3 года назад
You would need to look into for example using a bind mount directly in your service declaration I would presume. It simply cant find the drive.
@julienboudreau6847
@julienboudreau6847 2 года назад
There appears to be an issue - when using django-compose run --rm django-admin startproject core . nothing happens. It does not create a django project. A few other commenters have had the same issue. Are you running in a venv? From your CLI, it doesn't seem to be the case.
@uzotammy
@uzotammy Год назад
I have the same problem. Would anyone be able to help?
@rajanbhamdari4903
@rajanbhamdari4903 Год назад
both "core . " and " core " doesnot make project what should i do . . terminal run successfully but doesn't make folder ..
@veryacademy
@veryacademy Год назад
What line of code are you expecting it to make a new folder?
@maulanaajiw6184
@maulanaajiw6184 Год назад
this tutorial doesn't help, because after i stop the server and will restart it, it doesn't work normally like the beginning of the video
@maulanaajiw6184
@maulanaajiw6184 Год назад
then after I repeated the "docker-compose up" method, the only thing that worked was the database container while the django container couldn't.
@maulanaajiw6184
@maulanaajiw6184 Год назад
then i also tried to run the django container with the command "docker container start" it also didn't work
@supritkumar2624
@supritkumar2624 Год назад
Only Content . Non other things
@walkerstark9584
@walkerstark9584 Год назад
i subscribe
@arturkabitcher
@arturkabitcher 2 года назад
Awesome stuff, thanks a lot.
Далее
Docker Tutorial for Beginners
50:38
Просмотров 43 тыс.
How to create a great dev environment with Docker
29:55
Prepare a Django app for Deployment using Docker
39:10
Docker Compose in 12 Minutes
12:00
Просмотров 1,2 млн
Docker - Containerize a Django App
24:09
Просмотров 3,3 тыс.