Exploring Docker [2] - Docker Compose With Node & MongoDB

  Рет қаралды 231,071

Traversy Media

Traversy Media

Күн бұрын

Пікірлер: 305
@TraversyMedia
@TraversyMedia 6 жыл бұрын
If you want your data to persist in prod, add something like this to your mongo service... volumes: - ./data/db:/data/db .There are many resources online so when you create these files, be sure to check some other examples. This is a very basic setup
@KylanHurt
@KylanHurt 6 жыл бұрын
Beautiful. You probably just saved me at least a few hours of work. The whole point of a DB is persistence so that line of code helps a ton! Great video.
@bennet2444
@bennet2444 5 жыл бұрын
What about the Security of the Mongo Container? Anyway to manage it with docker as well?
@andressoop
@andressoop 5 жыл бұрын
Just to be clear on this. If I run "docker-compose down", the database will be cleared if it has no external volume right?
@sohammondal578
@sohammondal578 5 жыл бұрын
@@andressoop Yes exactly.
@wisdommatthew6775
@wisdommatthew6775 4 жыл бұрын
@@andressoop Yeah
@ivandrofly
@ivandrofly 6 жыл бұрын
your tutorials are always perfect. Audio: 10/10 Video: 10/10 Information: 10/10
@Mathias-cq3zo
@Mathias-cq3zo 4 жыл бұрын
plus we got a quick ssh and GitHub Key tutorial hahahha ** insert "I came looking for copper and I found gold" meme **
@DodaGarcia
@DodaGarcia 3 жыл бұрын
Password frustration comedy: 10/10
@DodaGarcia
@DodaGarcia 3 жыл бұрын
I’m glad you didn’t edit out your fumbling with the SSH keys and passwords, it was the most relatable part of the video 😂😭
@rohitagrawal769
@rohitagrawal769 Жыл бұрын
Thank you so much man!!. 02:25 This really helped me. After searching for 2 days i found this video and just small change and my codes are running now. Replaced localhost with the container service name in my url. Thanks once again!!
@thecondor5488
@thecondor5488 5 жыл бұрын
That was perfect. Made understanding how Docker makes it so easy to set up and run in several environments very easy to understand. Thanks again sir. As always clear and concise and to the point. Even the real world issue with SSH key was easy to understand and didn't take away from the purpose at all. Appreciate you!
@NazeerHolmes
@NazeerHolmes 5 жыл бұрын
Great tutorial. I appreciate the "hiccups", more realistic then many tuts out there. It give a sense of how things can be. Thanks!
@robbiedelrosario8638
@robbiedelrosario8638 6 жыл бұрын
This is really great! Hoping for a series on Kubernetes :D
@christopherparrish1293
@christopherparrish1293 5 жыл бұрын
I'm an infrastructure guy trying to dip his toe in to the microservices realm and part 1 & 2 of these videos lays it all out there in a way that makes sense. Good work, I'll be checking out some of your other videos as well!!!
@junehanabi1756
@junehanabi1756 4 жыл бұрын
I will vouch for Digital Ocean. I've used many providers over the years Go Daddy, Name cheap, Media Temple, etc... After I went to Digital Ocean I will never go back. I've been with them for many years and have watched them go through so many large changes but I've loved everyone of them. They offer so many more features now than they did when I first signed on, it's amazing. The pricing tiers are great, the pricing model is great, and in minutes I can add a free external firewall, a $5 CDN, inexpensive daily live full-image backups and manual full-image snapshots, domain hosting, Lets Encrypt auto-generation and a raw server just handed to you with no limits or restrictions. Who wouldn't want to use them lol.
@shauntonesify
@shauntonesify 3 жыл бұрын
Again, - Brad to the Rescue. Just started working with Docker-Compose and besides it not doing what I wanted- it kept installing packages with yarn :X glad this video was around to save my day... again.
@gaius_marius
@gaius_marius 5 жыл бұрын
Excellent tutorial. I've been a developer for 20 years but I'm a complete beginner with Docker. I've been watching some of your other videos and you have a treasure trove of info on many topics. Glad I found your channel!
@MrHumanwarrior
@MrHumanwarrior 5 жыл бұрын
Dude, I watched the part one of this and it's awesome. You definitely got me hyped about this DevOps thing... a great tutorial and great teacher. Bravo!
@Paul_Green
@Paul_Green 4 жыл бұрын
Great tutorial, thank you. It's worth pointing out you should always use a passphrase to protect your ssh private keys unless you really don't care about the hosts you put the public key on, which is probably the case for this demo, but viewers might not realise that.
@Leeboi305
@Leeboi305 4 жыл бұрын
This was awesome man. Followed it step by step, learned how to launch in D.O, learned how to generate ssh keys and even switch between ssh-agents because i didn't want to overwrite my previous key. Thanks for all you do!
@josphatoluoch5205
@josphatoluoch5205 4 жыл бұрын
I can't believe all this material is FREE. Thank a lot for the material.
@Bruno87198
@Bruno87198 4 жыл бұрын
For those that are having problems when accessing the localhost with $ docker-compose up you should do this in the docker-compose.yml REMOVE: links: - mongo AND REPLACE IT FOR: external_links: - mongo This worked for me, credits to: Doc1337 (he answered an issue in GitHub)
@nabeeljaved1742
@nabeeljaved1742 3 жыл бұрын
can i make image of both containers into one
@gtrockefellar
@gtrockefellar 5 жыл бұрын
Great video! I appreciate how genuine you come off as especially with the random phone "dings" and the random "Siht" bombs. It makes your videos easier to follow cause its' not a totally monotone script.
@rusa_
@rusa_ 2 жыл бұрын
Brilliant video. Just getting started with all of this. I found it easy to follow along. You kept the jargon simple. I appreciate it
@catherinedesrochers
@catherinedesrochers 4 жыл бұрын
The SSH Key hiccup was a good thing as it refreshed my memory about it!
@gumpie
@gumpie 6 жыл бұрын
Brad ... shout out from South Africa. This was awesome... Such good content. Docker seems a bit more simple for me now.
@jasdfpasdfakdsjhfa
@jasdfpasdfakdsjhfa 4 жыл бұрын
Hey Brad, thanks for the videos, you're awesome! Quick tip from one mac user to another you may not be aware of. On mac you can pipe a command to pbcopy in order to copy it to your system clipboard. So you can do "cat ~/.ssh/id_rsa_do.pub | pbcopy".
@subhajitdaripa3458
@subhajitdaripa3458 4 жыл бұрын
love you bro just love the way you teach things in simple yet effective manner have been following you for some time and I am already your fan
@rtorcato
@rtorcato 6 жыл бұрын
If you are new to docker you should run the 'docker system prune' command. If not you may eventually have a bunch of images taking up gigs of space on your drive
@carolinavalverde9034
@carolinavalverde9034 5 жыл бұрын
Please keep doing tutorial please. It’s rare to see tutorials of such high quality! Thank you!
@databridgeconsultants9163
@databridgeconsultants9163 4 жыл бұрын
Absolutely Awesome Content . Thank you very much . As I am a new beginner on Docker and Container , I feel very confident now .
@rpfour4
@rpfour4 5 жыл бұрын
Awesome video! Very casual, down to earth which I can totally connect because I share the same minor frustrations and occasional swearing. Way better than listening to someone reading a script or straight from wikipedia.
@fvgoya
@fvgoya 6 жыл бұрын
Man, you don't need to apologize!!!!! Even with this "mistake" turn to a recap of ssh!!! Appreciate it!!!!
@vincentschauer
@vincentschauer 3 жыл бұрын
Thanks a bunch! Great tutorial, and nice that you left the ssh key part etc. in the final edit, makes me feel normal :D
@arturocuya7578
@arturocuya7578 6 жыл бұрын
12:00 Links have been replaced by networks. Docker describes them as a legacy feature that you should avoid using. You can safely remove the link and the two containers will be able to refer to each other by their service name (or container_name). With compose, links do have a side effect of creating an implied dependency. You should replace this with a more explicit depends_on section so that the app doesn't attempt to run without or before redis starts. Source: stackoverflow.com/a/41294598/9226919
@Quartzaoe
@Quartzaoe 6 жыл бұрын
Docker is godsent, makes everything so much simpler
@nickfmatthews09
@nickfmatthews09 4 жыл бұрын
Genuinely love this walkthrough, but my favorite moments are: whispering "shit" and the 4 attempts to login.
@GG-uz8us
@GG-uz8us 3 жыл бұрын
Yeah, it's the real situation people are experiencing.
@codenx2
@codenx2 5 жыл бұрын
That ssh part helped me :) too. Thanks.
@noahwilliams8918
@noahwilliams8918 5 жыл бұрын
Super informative tutorial, as always! I was already was familiar with Docker when I started it, but the recap and detailed explanation of what you are doing and how everything works is always that extra +5% that gives one the confidence to deploy in production :) p.s. the best part of this tutorial was the "shit" in a Boston accent. As a New England ex-pat, that's a sound I've not heard in a long time! 😂👏
@johnragica1723
@johnragica1723 5 жыл бұрын
Excellent tutorial. Thank you for sharing this. It really helps a lot because your instructions are very clear and practical. More power to you.
@thriftynick27
@thriftynick27 6 жыл бұрын
Nice and simple, straightforward example. Exactly what I was looking for. Thanks!
@sarba85528
@sarba85528 2 жыл бұрын
Thank you, sir! I learned a lot following your codes, comment as well as all the explanation.
@macorreag
@macorreag 4 жыл бұрын
Information very important in 2:39 to solve problems to connect Nodejs and MongoDB.
@technics6215
@technics6215 5 жыл бұрын
Thanks for another nice 2in1 tutorial. I didn't realized that it is possible to work with ssh so efficient in shell :)
@daniel-deverell
@daniel-deverell 6 жыл бұрын
A Headless Wordpress video would be my next choice. Thanks for all you do.
@meirkhanyesseyev7275
@meirkhanyesseyev7275 6 жыл бұрын
Thank you for great Docker tutorials. Could you make some tutorials about Kubernetes, which basically uses Docker containers for servers.
@prakad97
@prakad97 4 жыл бұрын
Re-watching it in 2x speed..it was the same reactions that i give when i forget my password for github..hilarious..!! Great video brad..!!
@usmanmudasser5359
@usmanmudasser5359 5 жыл бұрын
Another great video. Man you are the best. Please add more docker networks and security related videos
@EduardKaresli
@EduardKaresli 6 жыл бұрын
These two videos about Docker are gold... Thanks a lot!!
@HearterSG
@HearterSG 5 жыл бұрын
docker is insane! and this tutorial also was insane. thanks brad!
@miriamramstudio3982
@miriamramstudio3982 4 жыл бұрын
Just what I needed. Very well explained. very good video. Thanks !!
@ivan-the-l
@ivan-the-l 4 жыл бұрын
Thx a lot for your tutorial! It helped me a lot with my college assignment :)
@diallomamadou258
@diallomamadou258 6 жыл бұрын
Always amazing content Brad, I'm so glad to be one of your subscribers. Thank you very much
@adilsaju
@adilsaju 5 жыл бұрын
Great video for beginners. Please do more on docker!
@muthuhari8875
@muthuhari8875 6 жыл бұрын
Hi Brad, please add some videos about debugging on vscode and if possible some testing toturials
@abbie3156
@abbie3156 5 жыл бұрын
Is there any technology you don't know! Excellent tutorials. keep up the good work.
@timothyhartley2791
@timothyhartley2791 6 жыл бұрын
Thanks for talking through the SSH issue.
@filozof666
@filozof666 4 жыл бұрын
6:00 what is the point of copying first package files when you will copy all anyway?
@milunacodes
@milunacodes 6 жыл бұрын
Awesome tutorial as usual. Thanks Brad!
@derricknjoroge2494
@derricknjoroge2494 4 жыл бұрын
Wow, this is amazing! Thank You Brad
@kaizoey
@kaizoey 4 жыл бұрын
If someone is getting "connection refused" connecting to their express server. In your dockerfile, you don't want to "RUN npm start". This is for running commands. Its better to define runtime with "CMD ["npm", "start"]"
@restuwahyusaputra7764
@restuwahyusaputra7764 4 жыл бұрын
Thanks Brad this is awesome free course
@onurtravels
@onurtravels 4 жыл бұрын
Doing the ssh configuration is also showing the process, nice 🙂
@ashutoshnayak609
@ashutoshnayak609 6 жыл бұрын
Wait 2 videos at the same time , I am on cloud 9 , thanks Brad.
@GfastGao
@GfastGao 5 жыл бұрын
Hi Brads, Awesome awesome tutorial for jump into Docker! thank you for your effort, really appreciate you contribution to the success of my career!
@GfastGao
@GfastGao 5 жыл бұрын
I specifically like the parts you speak out some F* world. Because I think it's the reallity when I coding and also very fun.
@zt.5677
@zt.5677 4 жыл бұрын
This is actually very good! Thanks!
@kelthuzal
@kelthuzal 6 жыл бұрын
Thanks fir great vdo, really waiting for Kubernetes series
@markwandrew
@markwandrew 5 жыл бұрын
If I already have a mongodb running on the host, and want the mongodb in docker to use a different port? There is something to look out for: If you just try to run the app as cloned from brad's github you will get an error message when the docker mongo tries to use the port (27017) that the existing mongo has already allocated. I first tried changing the port mapping in the docker-compose file to '27018:27017' and altering the url in index.js to 'mongodb://mongo:27018/docker-node-mongo' but I was still getting [MongoNetworkError: connect ECONNREFUSED 172.18.0.2:27018] when I do docker-compose-up. And then it dawned on me ... The mapping for the mongo port ('27018:27017') only changes how someone on the host will see the it. The node app is in "docker land" and will still see the docker mongo at internal port 27017 - so you should keep the url in index.js as 'mongodb://mongo:27017/docker-node-mongo' . But when you want to connect to that mongo from the host, e.g. with a command line client, you use "mongo --port 27018" Seems blindingly obvious now, but it had me scratching my head for a while. Thanks for a great video Brad, just the right level to get people started.
@xadasol8692
@xadasol8692 5 жыл бұрын
It definitely deserves a massive like Thank you Brad
@fenilli
@fenilli 6 жыл бұрын
Only 2 videos of Docker and finally I get how Docker works and how to properly work with it... you could make a video on how to make a container workspace so you don't need to install npm, php, composer and all those in your local machine.
@chammidhan
@chammidhan 5 жыл бұрын
Awesome tutorial. Simple and to the point!
@HenkBadenhorst_MM
@HenkBadenhorst_MM 5 жыл бұрын
Thanks, fantastic intro to Docker!
@vixeven
@vixeven 6 жыл бұрын
Can you do a tutorial on > How to make unit tests for code coverage of a whole express project: including routes, controllers, models, etc.
@gigabyte2053
@gigabyte2053 5 жыл бұрын
you are amazing dude i have learned so much from you be happy for what you do for world bro
@comedycutout6958
@comedycutout6958 4 жыл бұрын
thank you sir for explaining the docker.
@factionzer0
@factionzer0 6 жыл бұрын
I am curious about the LAMP stack in Docker. I think it would be pretty relatable to a Flask stack with NGINX. That was my interest after this video. With NGINX you usually set up the configuration to point to the working directory of the Python virtual environment, set the domain name, ect. If NGINX is in a separate container from your Python app/service, how does it point to the Python app working directory?
@emdirtyyo1827
@emdirtyyo1827 4 жыл бұрын
I'm simple guy, when I see Brad's video, press thumb up button
@matthewhanyu6158
@matthewhanyu6158 5 жыл бұрын
Really great video, and it is very kind of you! Amazing! Thank you! Afterwards, you can create AWS hosting with dockerizing app instead of Deagital Ocean? Really it would be to expect the best video and I think there should be good guys to love you with that! Also hopefully can you make the video AWS + CI/CD + docker? It would be also a great video which attracts more fans!
@Wablestomp2
@Wablestomp2 4 жыл бұрын
Just the video(s) I was looking for! Thanks. It would be cool to see this mongodb, node app, and maybe another front end web application all being deployed on a windows 2016 server VM. I am doing something similar.
@javilionaire
@javilionaire 4 жыл бұрын
Would love to see some more docker stuff. A tutorial with react/express/mongo + docker would be awesome. Maybe even some Kubernetes at some point!
@nicholaspappas9351
@nicholaspappas9351 6 жыл бұрын
Awesome video. I'd love to see some more docker videos!
@NafeoJoy
@NafeoJoy 4 жыл бұрын
You are amazing Brad!
@coltonwilliams1565
@coltonwilliams1565 4 жыл бұрын
This was incredibly helpful. Thank you Brad
@wwhill8033
@wwhill8033 6 жыл бұрын
Another amazing Video, Thanks Brad and keep up the fantastic work!!
@anandanhumanoid
@anandanhumanoid 4 жыл бұрын
Great learning,Thanks for sharing Brad.
@arshadmunir9015
@arshadmunir9015 4 жыл бұрын
Excellent tutorial for beginners.
@marcofloriano
@marcofloriano 2 жыл бұрын
Thanks Brad for this tutorial. I had a little problem after docker composing up my app .. it runs but returns just the message "No items found" without any html, like a json response. Anyway it's a greate tutorial and helped a lot.
@batuhansahan
@batuhansahan 5 жыл бұрын
for who getting docker-compose error you need to install docker-compose 1-Copy the appropriate docker-compose binary from GitHub: $ sudo curl -L github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose 2-Fix permissions after download: $ sudo chmod +x /usr/local/bin/docker-compose 3-Verify success: $ docker-compose version now you can use docker-compose up
@darwinsanjayasendri8622
@darwinsanjayasendri8622 6 жыл бұрын
Thanks for the tutorial. It was simple and concise explanation.
@ademhodzic6712
@ademhodzic6712 6 жыл бұрын
Really nice tutorial! Thanks a lot. Keep up good work Brad...
@derwt7
@derwt7 6 жыл бұрын
omg thanks for taking the time to do this
@CerebralDad
@CerebralDad 4 жыл бұрын
Brad, is it possible to expose a port in a Dockerfile based on an environment variable (ie process.env.PORT) - thanks
@erickloningo2252
@erickloningo2252 4 жыл бұрын
you are a life saver. thanks alot man. really helped me alot
@qbamc
@qbamc 5 жыл бұрын
Nice video. For your next video on this, can you include how to make the volume of the database persistent in Digital Ocean?
@matiasrondan
@matiasrondan 4 жыл бұрын
Very helpful, thank you! Congratulations for the great content!
@ahmedmusawir
@ahmedmusawir 6 жыл бұрын
Awesome! Need more Docker ... MERN stack apps, Kubernetes, AWS, Google Cloud etc. Thanx in advance.
@billpliske
@billpliske 5 жыл бұрын
Very helpful, Brad. Great job!
@dzengiztafa7964
@dzengiztafa7964 5 жыл бұрын
Thank you Traversy Media. I was looking for a way to publish our MERN project at work on our server. This tutorial pointed me in the right direction to do that. I reckon it is only a matter of linking the NodeJS restAPI to the mongodb & the react frontend through the "links" in your docker compose file?
@kirtho07
@kirtho07 2 жыл бұрын
Hello Sir your lectures are awesome! Thank you I
@NoNameChannelSigma
@NoNameChannelSigma Жыл бұрын
perfect lesson, thank you for your efforts
@i.p.knightly149
@i.p.knightly149 4 жыл бұрын
If anybody is still watching, 5:46 why use a COPY package*.json command when you do a COPY . . two commands later, isn't that redundant?
@awabelmahe9700
@awabelmahe9700 4 жыл бұрын
I think you could have gone with git clone on the server to pull the repo instead of ssh. That wouldn't have required a key or password. Great video as always. Thank you for sharing.
@rroblesgo
@rroblesgo 6 жыл бұрын
Excelent as always Mr. Brad !!
@nilsdomin3120
@nilsdomin3120 6 жыл бұрын
Great, thanks! Suggestion: You could make a tutorial with the MERN stack, e. g. with your Devconnector app.
@bulldog2024
@bulldog2024 3 жыл бұрын
Is there a way to display a maintenance page if the containers are not working?
@brindch8372
@brindch8372 4 жыл бұрын
that laugh is contagious 23:22 LOL
Exploring Docker [1] - Getting Started
34:38
Traversy Media
Рет қаралды 411 М.
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 369 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
How to Run MongoDB in Docker
11:44
ScriptBytes
Рет қаралды 25 М.
Has Coding Become Boring?
10:36
Traversy Media
Рет қаралды 29 М.
Git & GitHub Crash Course 2025
49:29
Traversy Media
Рет қаралды 7 М.
What Is A RESTful API? Explanation of REST & HTTP
18:38
Traversy Media
Рет қаралды 1,4 МЛН
Connect Node to MongoDB with Docker and Docker Compose
15:02
Build a CRUD API with Docker Node.JS Express.JS & PostgreSQL
26:02
Full NGINX Tutorial - Demo Project with Node.js, Docker
1:11:40
TechWorld with Nana
Рет қаралды 96 М.
Quick Wordpress Setup With Docker
14:57
Traversy Media
Рет қаралды 203 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН