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

  Рет қаралды 51,193

Very Academy

Very Academy

Күн бұрын

Пікірлер: 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?
@catta6449
@catta6449 Жыл бұрын
i've wathced so many tutorials, now i finally understand. sincerely, many many thanks to you.
@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.
@jmpersic
@jmpersic 2 жыл бұрын
Best tutorial I've found so far.
@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! 👍
@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 👍
@KuriakoseKuruvilaAnathanam
@KuriakoseKuruvilaAnathanam 8 ай бұрын
Incredibly informative tutorial.
@veryacademy
@veryacademy 7 ай бұрын
Glad you liked it
@mohankrishna1443
@mohankrishna1443 7 ай бұрын
🙇 I bow my head sir! this Tutorial helped me a lot.
@veryacademy
@veryacademy 7 ай бұрын
Thank you.
@mohankrishna1443
@mohankrishna1443 8 ай бұрын
This is just awesome
@TheAlibigdeli
@TheAlibigdeli 3 жыл бұрын
thank you for your awesome tutorials around the django framework
@veryacademy
@veryacademy 3 жыл бұрын
You are welcome!
@hassanelabdallah5013
@hassanelabdallah5013 3 жыл бұрын
best teacher ever👌🏻😉
@veryacademy
@veryacademy 3 жыл бұрын
Thank you! 😃
@archienemigo
@archienemigo Жыл бұрын
lov ya man you nailed it
@LifeOf97
@LifeOf97 2 жыл бұрын
This is really easy to understand, thanks Very Academy.
@Morgan035
@Morgan035 Жыл бұрын
Thanks you very helpful
@veryacademy
@veryacademy Жыл бұрын
You're welcome!
@txcing9296
@txcing9296 2 жыл бұрын
you are amazing. thank you so much
@veryacademy
@veryacademy 2 жыл бұрын
Thank you 🙏
@berkefekeskin9172
@berkefekeskin9172 3 ай бұрын
i love docker
@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
@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
@GoziePO
@GoziePO 11 ай бұрын
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.
@yashasbharadwaj4721
@yashasbharadwaj4721 3 жыл бұрын
tq so much sir really amazing
@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!
@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.
@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
@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
@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?
@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.
@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 :-)
@gflorin7761
@gflorin7761 Жыл бұрын
Hi! Do you still need to "COPY requirements.txt requirements.txt" if the "." directory is already mounted on "/django" on the container?
@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 жыл бұрын
👍
@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
@fahadmdkamal530
@fahadmdkamal530 2 жыл бұрын
Cannot add or modify files of the generated file using linux ubuntu. It says: permission denied
@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.
@gouravbansal994
@gouravbansal994 3 жыл бұрын
Are you using WSL2 in windows to run docker?
@veryacademy
@veryacademy 3 жыл бұрын
Yes 👍
@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
@bien-aimedimitri6450
@bien-aimedimitri6450 Жыл бұрын
Hi, my core app have the root permission how can i fix that
@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 11 ай бұрын
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.
@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?
@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?
@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?
@supritkumar2624
@supritkumar2624 Жыл бұрын
Only Content . Non other things
@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
@walkerstark9584
@walkerstark9584 Жыл бұрын
i subscribe
@arturkabitcher
@arturkabitcher 2 жыл бұрын
Awesome stuff, thanks a lot.
Docker | How to Dockerize a Django application (Beginners Guide)
20:08
escape in roblox in real life
00:13
Kan Andrey
Рет қаралды 81 МЛН
LIFEHACK😳 Rate our backpacks 1-10 😜🔥🎒
00:13
Diana Belitskay
Рет қаралды 3,7 МЛН
Пришёл к другу на ночёвку 😂
01:00
Cadrol&Fatich
Рет қаралды 11 МЛН
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 44 МЛН
Do NOT Learn Kubernetes Without Knowing These Concepts...
13:01
Travis Media
Рет қаралды 293 М.
Docker | Towards serving React (Nginx) with Django API (gunicorn)
48:35
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 448 М.
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 103 М.
Docker - Django, Celery & Redis Docker Compose setup
20:29
Very Academy
Рет қаралды 44 М.
Dockerizing Django with Postgres, Redis and Celery
20:59
Developer Timeline
Рет қаралды 14 М.
How To Use Docker To Make Local Development A Breeze
21:53
ArjanCodes
Рет қаралды 314 М.
What does larger scale software development look like?
24:15
Web Dev Cody
Рет қаралды 1,4 МЛН
How to Dockerize Django in 5 minutes
36:00
Matt Freire
Рет қаралды 31 М.
escape in roblox in real life
00:13
Kan Andrey
Рет қаралды 81 МЛН