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
@KylanHurt6 жыл бұрын
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.
@bennet24445 жыл бұрын
What about the Security of the Mongo Container? Anyway to manage it with docker as well?
@andressoop5 жыл бұрын
Just to be clear on this. If I run "docker-compose down", the database will be cleared if it has no external volume right?
@sohammondal5785 жыл бұрын
@@andressoop Yes exactly.
@wisdommatthew67754 жыл бұрын
@@andressoop Yeah
@ivandrofly6 жыл бұрын
your tutorials are always perfect. Audio: 10/10 Video: 10/10 Information: 10/10
@Mathias-cq3zo4 жыл бұрын
plus we got a quick ssh and GitHub Key tutorial hahahha ** insert "I came looking for copper and I found gold" meme **
@DodaGarcia3 жыл бұрын
Password frustration comedy: 10/10
@DodaGarcia3 жыл бұрын
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 Жыл бұрын
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!!
@thecondor54885 жыл бұрын
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!
@NazeerHolmes5 жыл бұрын
Great tutorial. I appreciate the "hiccups", more realistic then many tuts out there. It give a sense of how things can be. Thanks!
@robbiedelrosario86386 жыл бұрын
This is really great! Hoping for a series on Kubernetes :D
@christopherparrish12935 жыл бұрын
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!!!
@junehanabi17564 жыл бұрын
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.
@shauntonesify3 жыл бұрын
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_marius5 жыл бұрын
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!
@MrHumanwarrior5 жыл бұрын
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_Green4 жыл бұрын
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.
@Leeboi3054 жыл бұрын
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!
@josphatoluoch52054 жыл бұрын
I can't believe all this material is FREE. Thank a lot for the material.
@Bruno871984 жыл бұрын
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)
@nabeeljaved17423 жыл бұрын
can i make image of both containers into one
@gtrockefellar5 жыл бұрын
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_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
@catherinedesrochers4 жыл бұрын
The SSH Key hiccup was a good thing as it refreshed my memory about it!
@gumpie6 жыл бұрын
Brad ... shout out from South Africa. This was awesome... Such good content. Docker seems a bit more simple for me now.
@jasdfpasdfakdsjhfa4 жыл бұрын
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".
@subhajitdaripa34584 жыл бұрын
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
@rtorcato6 жыл бұрын
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
@carolinavalverde90345 жыл бұрын
Please keep doing tutorial please. It’s rare to see tutorials of such high quality! Thank you!
@databridgeconsultants91634 жыл бұрын
Absolutely Awesome Content . Thank you very much . As I am a new beginner on Docker and Container , I feel very confident now .
@rpfour45 жыл бұрын
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.
@fvgoya6 жыл бұрын
Man, you don't need to apologize!!!!! Even with this "mistake" turn to a recap of ssh!!! Appreciate it!!!!
@vincentschauer3 жыл бұрын
Thanks a bunch! Great tutorial, and nice that you left the ssh key part etc. in the final edit, makes me feel normal :D
@arturocuya75786 жыл бұрын
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
@Quartzaoe6 жыл бұрын
Docker is godsent, makes everything so much simpler
@nickfmatthews094 жыл бұрын
Genuinely love this walkthrough, but my favorite moments are: whispering "shit" and the 4 attempts to login.
@GG-uz8us3 жыл бұрын
Yeah, it's the real situation people are experiencing.
@codenx25 жыл бұрын
That ssh part helped me :) too. Thanks.
@noahwilliams89185 жыл бұрын
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! 😂👏
@johnragica17235 жыл бұрын
Excellent tutorial. Thank you for sharing this. It really helps a lot because your instructions are very clear and practical. More power to you.
@thriftynick276 жыл бұрын
Nice and simple, straightforward example. Exactly what I was looking for. Thanks!
@sarba855282 жыл бұрын
Thank you, sir! I learned a lot following your codes, comment as well as all the explanation.
@macorreag4 жыл бұрын
Information very important in 2:39 to solve problems to connect Nodejs and MongoDB.
@technics62155 жыл бұрын
Thanks for another nice 2in1 tutorial. I didn't realized that it is possible to work with ssh so efficient in shell :)
@daniel-deverell6 жыл бұрын
A Headless Wordpress video would be my next choice. Thanks for all you do.
@meirkhanyesseyev72756 жыл бұрын
Thank you for great Docker tutorials. Could you make some tutorials about Kubernetes, which basically uses Docker containers for servers.
@prakad974 жыл бұрын
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..!!
@usmanmudasser53595 жыл бұрын
Another great video. Man you are the best. Please add more docker networks and security related videos
@EduardKaresli6 жыл бұрын
These two videos about Docker are gold... Thanks a lot!!
@HearterSG5 жыл бұрын
docker is insane! and this tutorial also was insane. thanks brad!
@miriamramstudio39824 жыл бұрын
Just what I needed. Very well explained. very good video. Thanks !!
@ivan-the-l4 жыл бұрын
Thx a lot for your tutorial! It helped me a lot with my college assignment :)
@diallomamadou2586 жыл бұрын
Always amazing content Brad, I'm so glad to be one of your subscribers. Thank you very much
@adilsaju5 жыл бұрын
Great video for beginners. Please do more on docker!
@muthuhari88756 жыл бұрын
Hi Brad, please add some videos about debugging on vscode and if possible some testing toturials
@abbie31565 жыл бұрын
Is there any technology you don't know! Excellent tutorials. keep up the good work.
@timothyhartley27916 жыл бұрын
Thanks for talking through the SSH issue.
@filozof6664 жыл бұрын
6:00 what is the point of copying first package files when you will copy all anyway?
@milunacodes6 жыл бұрын
Awesome tutorial as usual. Thanks Brad!
@derricknjoroge24944 жыл бұрын
Wow, this is amazing! Thank You Brad
@kaizoey4 жыл бұрын
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"]"
@restuwahyusaputra77644 жыл бұрын
Thanks Brad this is awesome free course
@onurtravels4 жыл бұрын
Doing the ssh configuration is also showing the process, nice 🙂
@ashutoshnayak6096 жыл бұрын
Wait 2 videos at the same time , I am on cloud 9 , thanks Brad.
@GfastGao5 жыл бұрын
Hi Brads, Awesome awesome tutorial for jump into Docker! thank you for your effort, really appreciate you contribution to the success of my career!
@GfastGao5 жыл бұрын
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.56774 жыл бұрын
This is actually very good! Thanks!
@kelthuzal6 жыл бұрын
Thanks fir great vdo, really waiting for Kubernetes series
@markwandrew5 жыл бұрын
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.
@xadasol86925 жыл бұрын
It definitely deserves a massive like Thank you Brad
@fenilli6 жыл бұрын
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.
@chammidhan5 жыл бұрын
Awesome tutorial. Simple and to the point!
@HenkBadenhorst_MM5 жыл бұрын
Thanks, fantastic intro to Docker!
@vixeven6 жыл бұрын
Can you do a tutorial on > How to make unit tests for code coverage of a whole express project: including routes, controllers, models, etc.
@gigabyte20535 жыл бұрын
you are amazing dude i have learned so much from you be happy for what you do for world bro
@comedycutout69584 жыл бұрын
thank you sir for explaining the docker.
@factionzer06 жыл бұрын
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?
@emdirtyyo18274 жыл бұрын
I'm simple guy, when I see Brad's video, press thumb up button
@matthewhanyu61585 жыл бұрын
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!
@Wablestomp24 жыл бұрын
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.
@javilionaire4 жыл бұрын
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!
@nicholaspappas93516 жыл бұрын
Awesome video. I'd love to see some more docker videos!
@NafeoJoy4 жыл бұрын
You are amazing Brad!
@coltonwilliams15654 жыл бұрын
This was incredibly helpful. Thank you Brad
@wwhill80336 жыл бұрын
Another amazing Video, Thanks Brad and keep up the fantastic work!!
@anandanhumanoid4 жыл бұрын
Great learning,Thanks for sharing Brad.
@arshadmunir90154 жыл бұрын
Excellent tutorial for beginners.
@marcofloriano2 жыл бұрын
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.
@batuhansahan5 жыл бұрын
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
@darwinsanjayasendri86226 жыл бұрын
Thanks for the tutorial. It was simple and concise explanation.
@ademhodzic67126 жыл бұрын
Really nice tutorial! Thanks a lot. Keep up good work Brad...
@derwt76 жыл бұрын
omg thanks for taking the time to do this
@CerebralDad4 жыл бұрын
Brad, is it possible to expose a port in a Dockerfile based on an environment variable (ie process.env.PORT) - thanks
@erickloningo22524 жыл бұрын
you are a life saver. thanks alot man. really helped me alot
@qbamc5 жыл бұрын
Nice video. For your next video on this, can you include how to make the volume of the database persistent in Digital Ocean?
@matiasrondan4 жыл бұрын
Very helpful, thank you! Congratulations for the great content!
@ahmedmusawir6 жыл бұрын
Awesome! Need more Docker ... MERN stack apps, Kubernetes, AWS, Google Cloud etc. Thanx in advance.
@billpliske5 жыл бұрын
Very helpful, Brad. Great job!
@dzengiztafa79645 жыл бұрын
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?
@kirtho072 жыл бұрын
Hello Sir your lectures are awesome! Thank you I
@NoNameChannelSigma Жыл бұрын
perfect lesson, thank you for your efforts
@i.p.knightly1494 жыл бұрын
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?
@awabelmahe97004 жыл бұрын
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.
@rroblesgo6 жыл бұрын
Excelent as always Mr. Brad !!
@nilsdomin31206 жыл бұрын
Great, thanks! Suggestion: You could make a tutorial with the MERN stack, e. g. with your Devconnector app.
@bulldog20243 жыл бұрын
Is there a way to display a maintenance page if the containers are not working?