Docker Compose in 6 minutes! Mongo, Express, React, Node (MERN) Application Tutorial

  Рет қаралды 94,150

DevOps Directive

DevOps Directive

Күн бұрын

Пікірлер: 239
@befrog57
@befrog57 4 жыл бұрын
Amazing video! You explained everything in a very understandable and clear way without oversimplyfing it. Love it
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Great to hear -- that is always my goal!
@lionelaustin5523
@lionelaustin5523 3 жыл бұрын
I realize it is kinda randomly asking but do anybody know of a good website to stream newly released tv shows online?
@geraldvictor3467
@geraldvictor3467 3 жыл бұрын
@Lionel Austin I use flixzone. Just search on google for it :)
@salvatoretrey9697
@salvatoretrey9697 3 жыл бұрын
@Gerald Victor yup, have been using FlixZone for since march myself :)
@lionelaustin5523
@lionelaustin5523 3 жыл бұрын
@Gerald Victor Thank you, signed up and it seems to work :) I really appreciate it!!
@Dan-codes
@Dan-codes 2 жыл бұрын
I love the pace that you work through things, no filler and everything I need as a devops newb.
@marjie9288
@marjie9288 3 жыл бұрын
This just one video it solves all my problems on MERN. You are a God sent to us. I'm from the Philippines.
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Great to hear! Hello from the USA 👋
@BulletSP
@BulletSP 10 ай бұрын
thanks man for saving our time, u explained it very crisp and concise and fully comprehensible
@Gwittdog
@Gwittdog 6 ай бұрын
This video is freaking brilliant. High level yet concise. You have my bell icon being rang.
@bulelanibotman
@bulelanibotman 2 жыл бұрын
what an informative video, i don't know much about docker but i was able to understand what docker compose does in just a few minutes into the video. you add yourself a subscriber
@shivangitomar5557
@shivangitomar5557 3 жыл бұрын
I finally understood after watching 10 other videos! You are amazing!!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Happy to hear that!
@mainulislamfaruqi
@mainulislamfaruqi 2 жыл бұрын
We have to give a comment for appreciation such an amazing content. So organized, easy to understand.
@DevOpsDirective
@DevOpsDirective 2 жыл бұрын
I appreciate that!
@Rodrigo-lq2iy
@Rodrigo-lq2iy 3 жыл бұрын
It's amazing, i feel i learnt way more than 6 minutes. Totally subscribing and recommending this channel! Thank you very much!!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Woo! Thanks, @Rodrigo!
@renzzogomez2134
@renzzogomez2134 2 жыл бұрын
Thanks a lot mate, I was needing this for a project, great job, please keep rocking!!!
@rodrigolustosa9090
@rodrigolustosa9090 4 жыл бұрын
Damn!! i'm not even a speaker of your language, and still got the whole ideia.Nice vídeo my friend, you earned a new subscriber!! Hope now i'm going to be able to absorb this whole docker thing
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Amazing! Welcome to the team! 👋👋👋 I have a few other Docker videos as well if you want to check those out.
@chiragkhachane9739
@chiragkhachane9739 4 жыл бұрын
Hey man this video was just the thing I was looking for. Solved some of my queries to! Thanks for the tutorial.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Awesome! Are you building something with docker compose?
@chiragkhachane9739
@chiragkhachane9739 4 жыл бұрын
@@DevOpsDirective Yeah. I am building my Undergraduate Project with Docker and MERN stack.
@sureshkrishnan83
@sureshkrishnan83 4 жыл бұрын
I probably end up watch all your video by end of this weekend . 😀..thanks
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Epic! Depending on which order you watch, you will see the production quality going ⬆️ or ⬇️ and my beard growing or shrinking 🧔
@conandev3710
@conandev3710 3 жыл бұрын
Well-made, high-quality video. Subscribed. Well done!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thank you, Conan! Welcome to the team! 🎉
@markay_
@markay_ 3 жыл бұрын
this is awesome stuff! was able to build my frontend and backend images and execute them with docker-compose. thx!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Glad it helped!
@sriraghariharan130
@sriraghariharan130 7 ай бұрын
Short and knowledge heavy ❤
@KieCodes
@KieCodes 4 жыл бұрын
Wow, amazing video, and congratulations on 500 subs! 🙏
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks Kie -- trying to keep up with you! 😎
@KieCodes
@KieCodes 4 жыл бұрын
@@DevOpsDirective Man, you surpass me easily! My upload schedule is a mess right now. :D
@nuwan9266
@nuwan9266 2 жыл бұрын
Superb. Everything you explained is pretty clear!
@DevOpsDirective
@DevOpsDirective 2 жыл бұрын
Thanks, Nuwan!
@linocesar6328
@linocesar6328 3 жыл бұрын
thanks for the video, I'm starting to get to know this technology, and I find it super useful, I want to use it with the MERN stack.
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
You are welcome! Good luck!
@MJ-ih1yu
@MJ-ih1yu 4 жыл бұрын
Great explanation! Keep teaching👌
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @MJ! I plan to!
@chiraggarg8012
@chiraggarg8012 3 жыл бұрын
Thanks. This tutorial clarified my mistakes. Amazing Video
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Awesome -- I'm happy it helped! 🎉
@jamessteph9088
@jamessteph9088 2 жыл бұрын
Wow!! Great content. simple and well explained. Thank you so much.
@chiefterribleteacher8687
@chiefterribleteacher8687 4 жыл бұрын
Concise and super helpful, thanks for sharing!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Chief Terrible Teacher! I'm planning to do a follow up soon where I take the same setup and make some tweaks to make it more suitable for deployment (since this video shows a development configuration) Stay tuned!
@Gacu700
@Gacu700 3 жыл бұрын
THIS MOVIE ACTUALLLY WORKS! Tahnk you very much, now i get it :D
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
You are welcome!
@LeviAckerman-pl9um
@LeviAckerman-pl9um 3 жыл бұрын
Short informative and simple, thank you for sharing. here's a sub
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thanks, Mehdi! Welcome to the Team! 🎉
@miladjamali6289
@miladjamali6289 2 жыл бұрын
nice and clear toturial by the way thank you
@TuomoKankaanpaa
@TuomoKankaanpaa 4 жыл бұрын
Nice video! 👍 Im using docker compose daily to spin up my dev environment that includes e.g. node, postgres, redis and react.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
It's a game changer, isn't it? Up and running with a single command!
@TuomoKankaanpaa
@TuomoKankaanpaa 4 жыл бұрын
@@DevOpsDirective Yea for sure, fast and easy!
@Uzakoff_u
@Uzakoff_u Ай бұрын
Finally, understood, thanks a lot!!!!!!!!
@hafizsabihulhassan1905
@hafizsabihulhassan1905 3 жыл бұрын
Very simple precise and perfect you are awesome brother
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thanks @Hafiz! 🎉
@ayoubmanar9205
@ayoubmanar9205 2 жыл бұрын
MAN YOU ARE TOO MUCH GOOD
@PeterFullen
@PeterFullen 3 жыл бұрын
Really great concise video
@Gamer8308
@Gamer8308 4 жыл бұрын
Really loved the video !! Helped me a lot thanks !
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Amazing -- thanks for watching and for letting me know!
@farzadsole3784
@farzadsole3784 4 жыл бұрын
Excellent video, however I had to add the following 2 lines under docker-compose file to get things working; Under "react-app:" add > build: ./client Same for "api-server:" add > build: ./server Thanks
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Farzad! I build the images separately (before running docker-compose up) which is why I was able to use just the "image" name in the docker compose file!
@harrisonfok8267
@harrisonfok8267 Жыл бұрын
Wow this is really helpful!
@consoledoterror971
@consoledoterror971 3 жыл бұрын
"Just keep building" Subbed. Thanks
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
It's the only way to get better! Welcome to the team!
@pedruchu259
@pedruchu259 3 жыл бұрын
You are a God, thanks so much, you saved my life!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Glad I could help, @Drukan!
@externemw3
@externemw3 4 жыл бұрын
Thank you! Awesome! Greetings from Brazil :)
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Jeliel! 👋👋
@mohammadsaad4419
@mohammadsaad4419 4 жыл бұрын
this is one great video man, keep it up.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks -- will do!
@kumarv1374
@kumarv1374 2 жыл бұрын
After changing the mondb url from localhost to mongo where I can see it in mongodb compass because iam not able see the data stored after changing it to mongo
@darwish-mammo
@darwish-mammo 3 жыл бұрын
you're a great guy mate! thanks for the video
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thanks @Darwish, and you are welcome!
@ssaai
@ssaai 2 жыл бұрын
Excellent 👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻
@edu_sdorneles
@edu_sdorneles Жыл бұрын
What a great video!!!
@MjCarnaje-jd5ut
@MjCarnaje-jd5ut 3 жыл бұрын
THANK YOUU!! very understandable!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
You're welcome!
@Abel_Lopez_
@Abel_Lopez_ 4 жыл бұрын
Awesome! Amazing explanation, thank you!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
You are welcome!
@huynhthanhnhan63
@huynhthanhnhan63 Ай бұрын
Let me ask, if I do as you do, how can I connect to moongoseDb conpass to check the data? Thank you very much.
@ced4841
@ced4841 4 жыл бұрын
Good Video, pleasant voice!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Ced!
@SamarthRawat
@SamarthRawat 2 жыл бұрын
Thanks for the amazing tutorial. I am learning docker, your video really helped me learn to dockerize the MERN app. But the I am not able to add movie. when i open localhost:5000 i get "Hello world" as result. Please help me understand this
@meshavegas
@meshavegas 11 ай бұрын
I have a question if instead of using the network I use nginx is a correct practice?
@girlsincode9255
@girlsincode9255 3 жыл бұрын
simple and clear.great !!!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thanks @girls in code! 🥳
@HoaLe-jx3gg
@HoaLe-jx3gg 3 жыл бұрын
Very useful!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Glad to hear that, @Hòa!
@thear0a
@thear0a 3 жыл бұрын
thanks, short and to the point
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
You are welcome, @Alrz! 🎉
@BDominikGT
@BDominikGT 3 жыл бұрын
Perfect!!! Thank you very much.
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
👌-- you are welcome @Balog!
@joshuastrozzi737
@joshuastrozzi737 Жыл бұрын
I'm new to deploying apps. Why do we containerize our react app? I understand the backend and database, also microservices, but why the front end?? How do you even deploy a containerized front end? Wouldn't you want to just deploy the static files? Clarity on this is appreciated! :)
@DevOpsDirective
@DevOpsDirective Жыл бұрын
This is a great question! For deployment: You are correct that you would want to deploy the output of your build step (i.e. the static files it produces). There are lots of ways to do this, one of which would be to bundle those files into a container with something like nginx and deploy that way. If you are already deploying your other applications with a container orchestrator, this allows you to deploy and operate everything in the same way. For development: If you containerize it you can include it within your docker-compose setup so that everyone working on it will share a common setup (rather than needing everyone to have the same versions of all the system dependencies (e.g. node, vite, etc...) Hopefully that helps!
@anasanchez6088-d5i
@anasanchez6088-d5i 3 жыл бұрын
Excellent!!thank!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
You are welcome, Ana!
@ousmanevincentdione9369
@ousmanevincentdione9369 4 жыл бұрын
Very helpful!! You are amazing!! very nice explanation! Thank you so much!! You fix my comprehension in just 6 minutes!! Can you make a tutorial with java ee wildfly postgres and angular please.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thank you for the kind words! I have minimal experience w/ Java and Angular, so I'm probably not the best person to make a tutorial like that.
@ousmanevincentdione9369
@ousmanevincentdione9369 4 жыл бұрын
@@DevOpsDirectiveOk. i understand.Thank you so much !!!
@antoniomagalhaes9812
@antoniomagalhaes9812 3 жыл бұрын
Great content, thank you.
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Glad it was helpful, @antonio! 🎉
@jackedelic9188
@jackedelic9188 4 жыл бұрын
I am confused, so before using docker-compose up, do we need to separately build the images for client and server?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Hi Jack -- For the Dockerfile shown in the video (github.com/sidpalas/devops-directive/blob/master/2020-08-31-docker-compose/docker-compose.yml), I specified the "image" directly so you have to build it first. (using "docker build -t ") If instead, I used the build option like here (gist.github.com/sidpalas/850a08326f46839057f611c05fa14f59), then docker-compose could automatically build the images before running. Here is the documentation for the build configuration option docs.docker.com/compose/compose-file/#build Does that help?
@jackedelic9188
@jackedelic9188 4 жыл бұрын
@@DevOpsDirective That absolutely helps :) Thanks for clearing my doubt
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@jackedelic9188 Great! Thanks for watching the video and being a part of the community. Keep the comments and questions coming!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@Mr 3xclamtion Good point!
@CryptoKosh
@CryptoKosh 3 жыл бұрын
❤️🔥
@hangtran4863
@hangtran4863 3 жыл бұрын
When running docker-compose up , I stumbled upon this error "ERROR: pull access denied for react-app-dev, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
This error message means you do not have a docker image with that tag locally so it is trying to pull one from DockerHub. This makes me think you probably did not build the image before running docker compose up!
@scoopedcontent
@scoopedcontent 3 жыл бұрын
My data is not displayed from database nor am I able to create new movies. It all worked before docker compose though . Can anyone help
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
KZbin comments are very cumbersome for technical discussions, but if you want to join the channel discord community someone can probably help! discord.gg/ExrENts5CT
@pavanvere5769
@pavanvere5769 3 жыл бұрын
How to change ip address with docker-compose instead of hardcoding
@Operaatoors
@Operaatoors 4 жыл бұрын
I would suggest to keep close the database mount, not using named volume but directly storing db data into folder
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Yes, that is a good point. That way if you ever prune all the dangling docker resources the data can still persist! Since this is just a development setup it's not too critical, and if deploying a configuration like this you probably don't want to run the DB in docker at all!
@aram5642
@aram5642 3 жыл бұрын
What was it that made Docker and the whole idea of containerization possible?
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Linux namespaces (used to confine what a process can see) and cgroups (used to limit the amount of resources a process can use) are the key! Docker came along and make the user experience for using these much nicer! 😀
@Levelord92
@Levelord92 3 жыл бұрын
You had 440 subscribers, now you have almost 9 thousand. Congrats! What if I need to specify username:password for images like Mongo/RabbitMQ?
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thanks @Levelord! You would likely want to specify them as an environment variable. In this video, I show one method of doing this: kzbin.info/www/bejne/epfXpIWbrs2taLM You can do this in the docker run command or with docker-compose (docs.docker.com/compose/environment-variables/#the-env_file-configuration-option)
@k4nful
@k4nful 4 жыл бұрын
What should we care if we want to use this docker compose file in production mode?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Great question, I actually have been planning a follow up to this video in which I show the steps that I would take before deploying this application. The updated code is already located here: github.com/sidpalas/devops-directive/tree/master/2020-12-21-productionize-mern But I haven't had a chance to film it yet... Feel free to join the channel discord if you have additional questions about the setup! discord.gg/d6geMBSg3M
@SaikumarN1993
@SaikumarN1993 3 жыл бұрын
Do I need to understand coding part for building thia docker compose file
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
While you could technically run the app without understanding the code, it will be much more useful to you if you do (because you will then be able to modify and extend it to fit your needs)
@OfoeNelson
@OfoeNelson 2 жыл бұрын
Thank you for this video. So how do you scale your containers if you want to scale after using docker compose?
@DevOpsDirective
@DevOpsDirective 2 жыл бұрын
If by " scale" you mean "run multiple copies of", Docker compose isn't really designed for that. For managing lots of replicas of your application containers you want an orchestrator like docker swarm, hashicorp nomad, or kubernetes. You could also deploy multiple copies of the container yourself but once you go beyond a single machine, you will end up hacking together your own version of an orchestrator 😆
@OfoeNelson
@OfoeNelson 2 жыл бұрын
@@DevOpsDirective Ok I asked because I'm thinking of how companies scale their container databases
@Chris-mr8qm
@Chris-mr8qm 3 жыл бұрын
Noob question here, do you have 1 container that contrains all services (réaction, mongo, api) or we have one container per serice?
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Generally you want to keep each container with a single service. There are some hacks you can do to run multiple things in a single container but it makes things harder to reason about, debug, etc...
@Chris-mr8qm
@Chris-mr8qm 3 жыл бұрын
@@DevOpsDirective Thank you for your answer. last one, is docker compose an orchestration then? how does it defer from kubernetes?
@datamike7457
@datamike7457 4 жыл бұрын
Do you have an example of a docker compose for the ml stack?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
I don't have any good examples on hand, but that could make a good future video! One example (which is admittedly a bit contrived...) could be if we took the movie MERN application from the video and wanted to add a "predicted rating" feature with an ML model (using inputs such as the title, the list of actors, the budget for the film, etc...). We would wrap our trained model with a lightweight webserver to enable it to accept requests, execute the model, and respond with the results. Once we had that, we would add this new inferencing API as another service within the docker-compose. This architecture is nice because we can use whatever language/dependencies we want for the ML model (independent of our technology choices for the rest of the app)!
@afshaarahmed2114
@afshaarahmed2114 2 жыл бұрын
ERROR: In file './docker-compose.yml', service 'image' must be a mapping not a string
@stsbmu7169
@stsbmu7169 4 жыл бұрын
Hello! Thank you very much for video! I would like to ask about the best way to work with Windows environment? In that I mean, I have multiple services and front-end applications are already dockerized and working well. But I have one service built on Node, which requires to be running on Windows 2016 server and for that I do all updates each time manually. Could you suggest what wholesome delivery method I can use for these?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
While I haven't worked with them, I know there are windows base docker images (hub.docker.com/_/microsoft-windows-base-os-images). This pull request (github.com/nodejs/docker-node/pull/362) shows someone using those base images to create a windows based Node image, but it looks like it hasn't been approved/merged yet. Maybe it will give some guidance on how to achieve what you are hoping for though!
@stsbmu7169
@stsbmu7169 4 жыл бұрын
@@DevOpsDirective Thank you very much! I will do more studying on it
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@stsbmu7169 Report back as you make progress! As I said, I have not worked with Windows based containers, so I'm interested to hear about your experience with them!
@stsbmu7169
@stsbmu7169 4 жыл бұрын
@@DevOpsDirective I will do!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@stsbmu7169 FYI, I recently started a discord server to make discussions like this easier than YT comments. Come join if you want! discord.gg/CHRvYhwvej
@zymasethecatalyst
@zymasethecatalyst 3 жыл бұрын
I want to use my mongodb atlas uri instead of mongo image How can i do so?
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
In this video I swap out the local DB for one running in atlas using an environment variable for the connection URI (kzbin.info/www/bejne/epfXpIWbrs2taLM) I hope that helps!
@shekharaakula6233
@shekharaakula6233 3 жыл бұрын
Great video, finally managed to make a monorepo work with docker but I want to know how to enable live reloading with this for development.
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Hey @Shekhar -- I'm glad it helped! I have implemented a few hot reloading docker configurations durin live streams on the channel, but it might be woth creating a dedicated video about how to use volume mounts to allow source code changes to be represented inside the container in real time.
@shekharaakula6233
@shekharaakula6233 3 жыл бұрын
@@DevOpsDirective That's great, I'll also check out your other vids.
@luppo2007
@luppo2007 4 жыл бұрын
nice video sir! i love it, i have one question im getting started with this docker compose thing. how i create an docker image " of all " to upload to my docker hub? i mean i dont want to create an image of my server side, another of my client and pull the mongo one. it is possible to create one only image and pull it all and run?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Hi @luppo2007 -- while you technically could run them all in a single container by adding a custom startup.sh script (or similar) to start the 3 processes is is generally a bad idea. There are a number of reasons for this, explained here: devops.stackexchange.com/questions/447/why-it-is-recommended-to-run-only-one-process-in-a-container
@PrieyudhaAkaditaS
@PrieyudhaAkaditaS 4 жыл бұрын
I have a question. What if i made some changes in express js or react js, do I need to type docker compose up again and the application will immediately change?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
As configured in the video you would have to rebuild the image first. In my recent livestream (kzbin.info/www/bejne/epfXpIWbrs2taLM) I showed how to mount the source code into the container using a volume so that changes can be reflected immediately!
@PrieyudhaAkaditaS
@PrieyudhaAkaditaS 4 жыл бұрын
@@DevOpsDirective thankyou, will look forward for it
@MuhammadBilal-cq6tp
@MuhammadBilal-cq6tp 2 жыл бұрын
Good Content.
@andreigatej6704
@andreigatej6704 3 жыл бұрын
Thanks for the great video! Just a small question. I assume the directory structure was something like this: ``` / api-server/ react-app/ ... ``` My question is, what happens if the `api-server` has its own repo? Is cloning the repo into an `api-server` directory and keeping it up to date a viable solution? Thanks!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Great question @andrei! Git actually has a feature called submodules that is designed exactly for this purpose! git-scm.com/book/en/v2/Git-Tools-Submodules You can have a separate repo for each service and the a top level repo that references them!
@andreigatej6704
@andreigatej6704 3 жыл бұрын
@@DevOpsDirective That's great! I've heard of them in the past and always wondered what they're for. Not it's time to look into it, thanks!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Another new software KZbinr ItGuyMichal coincidentally released a docker-compose video yesterday as well (kzbin.info/www/bejne/i3Opmnacl7esoac) His is a longer form tutorial (~40 min) where he walks through setting up docker-compose for configuring Postgres, pgAdmin, and Jupyterlab to work together. If you are looking for a more in-depth explanation/walk through, definitely check out his video and channel!
@albertoramos4312
@albertoramos4312 3 жыл бұрын
If I'm using a .env with mongo db atlas uri what should I do?
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Hi @Alberto! In this video I configure this app to use Atlas for the DB and use a .env file kzbin.info/www/bejne/epfXpIWbrs2taLM Hopefully it helps!
@albertoramos4312
@albertoramos4312 3 жыл бұрын
@@DevOpsDirective thanks a lot!
@ninow5
@ninow5 4 жыл бұрын
So basically docker compose creates a container with several images? Or does it still create 3 sepparate containers?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Good question! It still creates 3 separate containers, it just manages the set up and tear down (+ networking and volumes) with a single command and allows you to specify everything conveniently in one config file!
@angelosnm
@angelosnm 4 жыл бұрын
@@DevOpsDirective is it possible to merge them somehow in order to have one container containing those 3 containers as sub-containers? I'm asking in this with the purpose to eventually push my app to docker hub so as to pull & pull the container from anywhere
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@angelosnm You technically could run all three processes in one container but it would be bad practice. If one of the services had issues it would impact the others and be much harder to work with. It is best to keep each container focused on running 1 thing only.
@fkw0k3t4rd5
@fkw0k3t4rd5 4 жыл бұрын
So lets say every part of the project runs in its own directory with different github repos. Where exactly does the docker compose file go if there are multiple root directories? Does it go in the root of the front end or the backend? I feel like not understanding something fundamental here.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Good question! For the situation you described I would probably put the docker-compose file at the root of the backend repo and then use the git submodules (www.git-scm.com/book/en/v2/Git-Tools-Submodules) feature to make the frontend repo a sub directory within that repo. If there are even more services (each as their own repo) you could even have a separate integration repo which has all the services as submodules. My preference is just to use a single repo for everything ("Mono-repo") which simplifies your specific question, but adds its own complications elsewhere...
@fkw0k3t4rd5
@fkw0k3t4rd5 4 жыл бұрын
@@DevOpsDirective I was thinking of doing a Mono repos setup myself but wouldn't a large code base of a mono repo present more stability, efficiency, and more importantly scalability challenges? The codebase will be large enough to more than likely suffer from one or more of these issues. "Git fundamentally never really looks at less than the whole repo. Even if you limit things a bit (ie check out just a portion, or have the history go back just a bit), git ends up still always caring about the whole thing, and carrying the knowledge around. So git scales really badly if you force it to look at everything as one huge repository. I don't think that part is really fixable, although we can probably improve on it." -Linus Torvalds
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@Andrew -- how big a codebase are you working with? (in either SLOC or team size) The majority of projects will never reach a scale where Git itself becomes the bottleneck. For me, the benefits of being able to more quickly navigate and refactor across the codebase usually outweigh the (slightly) slower sync times or the need to configure CI/CD to be smart about detecting which services have been modified.
@fkw0k3t4rd5
@fkw0k3t4rd5 4 жыл бұрын
​@@DevOpsDirective I'm not sure what the SLOC will be because the project is still in the early stages. I'm a few weeks into creating the api using TDD and my endpoint tests alone are almost 5k lines of code. Edit: The tests I have so far are only for about 15 endpoints. I still have at least 30 to go. Hopeful that gives you an idea of the possible app scale.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@fkw0k3t4rd5 Yeah, I doubt you would have issues with something of that scale. I would choose whichever structure you are more comfortable with and will enable you to move the fastest during this initial development phase.
@oliver1231033
@oliver1231033 4 жыл бұрын
Great explanation, but I have some question: Do I have to use NGINX and/or pm2 with this setup? Or is this production-ready?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Hi Pych_1004 -- good question. This is a development setup and is not production-ready. To make it production-ready you would need to do a few things: For the React front end you would want to run npm run build (which builds it into a set of static files). These could then be served with something like nginx (you would probably want to add SSL termination w/in nginx as well to support HTTPS). For the Database, at the very least you will need to configure it with a password, and if the application becomes popular one of the first steps to scaling would be to move the DB off of the same machine as the server (and people debate whether it is a good idea to run a DB in a container for production at all... devops.stackexchange.com/questions/1293/what-are-the-reasons-docker-should-not-be-used-for-databases) Perhaps in the future, I'll do a follow-up video showcasing these steps!
@bryanmullen4462
@bryanmullen4462 4 жыл бұрын
@@DevOpsDirective +1 on this, would love to see how to make a set up like this production ready
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@bryanmullen4462 Awesome -- thanks for the input. I will put it into the backlog of future video ideas!
@bharathram3977
@bharathram3977 4 жыл бұрын
I am getting errors like this. Can you help me out? Pulling mongo (mongo:)... Traceback (most recent call last): File "site-packages\docker\credentials\store.py", line 80, in _execute File "subprocess.py", line 395, in check_output File "subprocess.py", line 487, in run subprocess.CalledProcessError: Command '['C:\\Program Files\\Docker\\Docker\ esources\\bin\\docker-credential-desktop.EXE', 'get']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "site-packages\docker\auth.py", line 264, in _resolve_authconfig_credstore File "site-packages\docker\credentials\store.py", line 35, in get File "site-packages\docker\credentials\store.py", line 93, in _execute docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error getting credentials - err: exec: "docker-credential-wincred.exe": executable file not found in %PATH%, out: ``". During handling of the above exception, another exception occurred: Traceback (most recent call last): File "docker-compose", line 6, in File "compose\cli\main.py", line 72, in main File "compose\cli\main.py", line 128, in perform_command File "compose\cli\main.py", line 1078, in up File "compose\cli\main.py", line 1074, in up File "compose\project.py", line 548, in up File "compose\service.py", line 361, in ensure_image_exists File "compose\service.py", line 1250, in pull File "compose\progress_stream.py", line 102, in get_digest_from_pull File "compose\service.py", line 1215, in _do_pull File "site-packages\docker\api\image.py", line 396, in pull File "site-packages\docker\auth.py", line 48, in get_config_header File "site-packages\docker\auth.py", line 324, in resolve_authconfig File "site-packages\docker\auth.py", line 235, in resolve_authconfig File "site-packages\docker\auth.py", line 281, in _resolve_authconfig_credstore docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "error getting credentials - err: exec: "docker-credential-wincred.exe": executable file not found in %PATH%, out: ``".') [16672] Failed to execute script docker-compose
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Hi Bharath -- Lets first confirm if your Docker Desktop install is working properly. What do you get if you test the docker version ("docker --version")? Also, can you run "docker run hello-world" (which will pull and run hub.docker.com/_/hello-world)?
@bharathram3977
@bharathram3977 4 жыл бұрын
@@DevOpsDirective Hi there, thanks for response. I figured out the issue. I was running all commands from Git bash in windows instead of Windows command prompt which somehow caused something to go wrong. But then, I ran into another error ( I have also posted it in stack overflow): stackoverflow.com/questions/63903112/mongo-connection-error-mongonetworkerror-failed-to-connect-to-server-localh
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@bharathram3977 It looks like the Stack Overflow question was removed... did you figure out the issue?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@bharathram3977 FYI, I recently started a discord server to make discussions like this easier than YT comments. Come join if you want! discord.gg/CHRvYhwvej
@michellegburgosf
@michellegburgosf 4 жыл бұрын
hi Sam! Your video is amazing. Could u pls help me use MEVN application for the same? Are The steps so different than MERN? Thank you
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Hi @Michelle -- It will be quite similar to the code shown in the video, just swapping Vue in for React! You will need to update the "client" implementation with one using Vue. Do you have the application running already without docker-compose?
@michellegburgosf
@michellegburgosf 4 жыл бұрын
@@DevOpsDirective Thank you so much :)
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@michellegburgosf You are welcome -- Let me know if you run into issues getting it up and running!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@michellegburgosf How is the MEVN app going? FYI, I recently started a discord server to make discussions like this easier than YT comments. Come join if you want! discord.gg/CHRvYhwvej
@domemvs
@domemvs 4 жыл бұрын
Can you elaborate on the stdin_open option?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Adding stdin_open: true is the equivalent of using the -i flag in a docker run command In this case it is kind of a hack to get around this issue: (github.com/facebook/create-react-app/issues/8688). Essentially there was an update earlier this year to React-Scripts that causes the react development server to exit after startup when run inside a docker container (at which point the container shuts down). Adding stdin_open: true tells docker to keep STDIN open even though its not attached to the process which keeps the container alive. This is similar to if you were to run: $ docker run node:slim (the container will start up and immediately terminate) versus if you run: $ docker run -i node:slim (the container will remain up after startup) I hope that helps!
@domemvs
@domemvs 4 жыл бұрын
DevOps Directive Thank you! Awesome explanation!
@GameChanger_SR
@GameChanger_SR 4 жыл бұрын
Hey man you are amazing , your explanation is clear and simple ,can you make a video on "how to deploy this application on GCP compute engine " thankyou dear
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @music! -- I have had a few people express interest in follow-ups to this video, so I will definitely make one! (not sure when though)
@kenny8422
@kenny8422 3 жыл бұрын
Great video! I'm learning docker and this was a great resource. Question though: Wouldn't the react-app depend on the api-server the same way the api-server depends on the mongo container?
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Great question! You are correct that in order to successfully load the page with the movie results in your browser, the react app needs the API server to be running. The difference is that those requests happen when you load the page not when you start the app! The react app is perfectly happy to start up independent of the other two services, whereas the API server will crash if it can't authenticate to the DB upon start up! I hope that helps!
@andrewgalloway8012
@andrewgalloway8012 3 жыл бұрын
I'm not sure how this stuff ends up working for people. I'm sure I'm doing something wrong, but it's always endless shots in the dark for me when it comes to Docker. I just want to get back to writing code :(
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
It is a fairly steep learning curve because of the additional abstraction, but once configured you shouldn't have to touch it much and hopefully will get teams writing code faster!
@md.fazlulkarim8847
@md.fazlulkarim8847 4 жыл бұрын
Awesome
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Md. Fazlul Karim!
@Quick_Code
@Quick_Code Жыл бұрын
super easy
@rangabharath4253
@rangabharath4253 4 жыл бұрын
awesome
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Ranga!
@jerrysofttechy6404
@jerrysofttechy6404 3 жыл бұрын
great
@ridl27
@ridl27 4 жыл бұрын
ty.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
yw!
@maxkinli
@maxkinli 11 ай бұрын
You can’t just run react app in webpack dev server and say this is your react docker container
@andTutin
@andTutin 2 жыл бұрын
whats the point any of this
@maxkinli
@maxkinli 11 ай бұрын
I’m in shock. 50 y.o guy teaching the wrong stuff… this is the real problem. Why this even exist
@andji8709
@andji8709 2 жыл бұрын
Amazing video! You explained everything in a very understandable and clear way without oversimplyfing it. Love it
How to Dockerize a MERN App | Docker Compose
44:00
Nikita Dev
Рет қаралды 7 М.
How to Dockerize NodeJS application with MongoDB
28:16
coder awesome
Рет қаралды 10 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 443 М.
Exploring Docker [2] - Docker Compose With Node & MongoDB
26:47
Traversy Media
Рет қаралды 231 М.
Docker Для Начинающих за 1 Час | Docker с Нуля
52:43
Docker для Начинающих - Полный Курс
1:58:39
Владилен Минин
Рет қаралды 869 М.
Do NOT Learn Kubernetes Without Knowing These Concepts...
13:01
Travis Media
Рет қаралды 339 М.
Do YOU Understand WHAT JUST HAPPENED!? 😂 #shorts
0:57
LankyBox World
Рет қаралды 1,6 МЛН
Такого Корпуса для ПК нет ни у кого в России
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 847 М.
Проверил, как вам?
1:01
Коннор
Рет қаралды 964 М.
Таким раствором работать одно удовольствие
1:00
Профессия созидатели
Рет қаралды 954 М.