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

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

Комментарии • 305

  • @TraversyMedia
    @TraversyMedia  6 лет назад +82

    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 лет назад +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 лет назад +1

      What about the Security of the Mongo Container? Anyway to manage it with docker as well?

    • @andressoop
      @andressoop 5 лет назад +2

      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 лет назад +1

      @@andressoop Yes exactly.

    • @wisdommatthew6775
      @wisdommatthew6775 3 года назад

      @@andressoop Yeah

  • @ivandrofly
    @ivandrofly 5 лет назад +215

    your tutorials are always perfect.
    Audio: 10/10
    Video: 10/10
    Information: 10/10

    • @Mathias-cq3zo
      @Mathias-cq3zo 4 года назад +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 года назад +1

      Password frustration comedy: 10/10

  • @DodaGarcia
    @DodaGarcia 3 года назад +19

    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 11 месяцев назад +1

    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!!

  • @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.

  • @robbiedelrosario8638
    @robbiedelrosario8638 5 лет назад +49

    This is really great! Hoping for a series on Kubernetes :D

  • @Paul_Green
    @Paul_Green 4 года назад +3

    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.

  • @thecondor5488
    @thecondor5488 5 лет назад +1

    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!

  • @christopherparrish1293
    @christopherparrish1293 5 лет назад +1

    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!!!

  • @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!

  • @NazeerHolmes
    @NazeerHolmes 5 лет назад +3

    Great tutorial. I appreciate the "hiccups", more realistic then many tuts out there. It give a sense of how things can be. Thanks!

  • @josphatoluoch5205
    @josphatoluoch5205 4 года назад

    I can't believe all this material is FREE.
    Thank a lot for the material.

  • @rtorcato
    @rtorcato 6 лет назад +1

    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

  • @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.

  • @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!

  • @nickfmatthews09
    @nickfmatthews09 4 года назад +11

    Genuinely love this walkthrough, but my favorite moments are: whispering "shit" and the 4 attempts to login.

    • @GG-uz8us
      @GG-uz8us 3 года назад +1

      Yeah, it's the real situation people are experiencing.

  • @MrHumanwarrior
    @MrHumanwarrior 4 года назад +6

    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!

  • @fvgoya
    @fvgoya 6 лет назад

    Man, you don't need to apologize!!!!! Even with this "mistake" turn to a recap of ssh!!! Appreciate it!!!!

  • @Quartzaoe
    @Quartzaoe 6 лет назад

    Docker is godsent, makes everything so much simpler

  • @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.

  • @Bruno87198
    @Bruno87198 4 года назад +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

  • @catherinedesrochers
    @catherinedesrochers 4 года назад +1

    The SSH Key hiccup was a good thing as it refreshed my memory about it!

  • @carolinavalverde9034
    @carolinavalverde9034 5 лет назад

    Please keep doing tutorial please. It’s rare to see tutorials of such high quality! Thank you!

  • @jasdfpasdfakdsjhfa
    @jasdfpasdfakdsjhfa 4 года назад +1

    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".

  • @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

  • @EduardKaresli
    @EduardKaresli 6 лет назад

    These two videos about Docker are gold...
    Thanks a lot!!

  • @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

  • @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 .

  • @thriftynick27
    @thriftynick27 6 лет назад +3

    Nice and simple, straightforward example. Exactly what I was looking for. Thanks!

  • @gumpie
    @gumpie 6 лет назад +1

    Brad ... shout out from South Africa. This was awesome... Such good content. Docker seems a bit more simple for me now.

  • @meirkhanyesseyev7275
    @meirkhanyesseyev7275 6 лет назад +11

    Thank you for great Docker tutorials. Could you make some tutorials about Kubernetes, which basically uses Docker containers for servers.

  • @rpfour4
    @rpfour4 4 года назад

    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.

  • @arturocuya7578
    @arturocuya7578 6 лет назад +3

    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

  • @restuwahyusaputra7764
    @restuwahyusaputra7764 4 года назад

    Thanks Brad this is awesome free course

  • @codenx2
    @codenx2 5 лет назад +6

    That ssh part helped me :) too. Thanks.

  • @timothyhartley2791
    @timothyhartley2791 6 лет назад

    Thanks for talking through the SSH issue.

  • @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 :)

  • @HearterSG
    @HearterSG 5 лет назад

    docker is insane! and this tutorial also was insane. thanks brad!

  • @muthuhari8875
    @muthuhari8875 6 лет назад +8

    Hi Brad, please add some videos about debugging on vscode and if possible some testing toturials

  • @daniel-deverell
    @daniel-deverell 5 лет назад

    A Headless Wordpress video would be my next choice. Thanks for all you do.

  • @vixeven
    @vixeven 6 лет назад +16

    Can you do a tutorial on > How to make unit tests for code coverage of a whole express project: including routes, controllers, models, etc.

  • @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..!!

  • @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.

  • @xadasol8692
    @xadasol8692 5 лет назад

    It definitely deserves a massive like
    Thank you Brad

  • @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

  • @milunacodes
    @milunacodes 6 лет назад +1

    Awesome tutorial as usual. Thanks Brad!

  • @derricknjoroge2494
    @derricknjoroge2494 4 года назад +1

    Wow, this is amazing! Thank You Brad

  • @comedycutout6958
    @comedycutout6958 4 года назад

    thank you sir for explaining the docker.

  • @noahwilliams8918
    @noahwilliams8918 5 лет назад +2

    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! 😂👏

  • @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"]"

  • @HenkBadenhorst_MM
    @HenkBadenhorst_MM 5 лет назад +1

    Thanks, fantastic intro to Docker!

  • @kelthuzal
    @kelthuzal 6 лет назад +5

    Thanks fir great vdo, really waiting for Kubernetes series

  • @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

  • @adilsaju
    @adilsaju 5 лет назад

    Great video for beginners. Please do more on docker!

  • @miriamramstudio3982
    @miriamramstudio3982 4 года назад

    Just what I needed. Very well explained. very good video. Thanks !!

  • @zt.5677
    @zt.5677 3 года назад

    This is actually very good! Thanks!

  • @arshadmunir9015
    @arshadmunir9015 4 года назад

    Excellent tutorial for beginners.

  • @sarba85528
    @sarba85528 2 года назад

    Thank you, sir! I learned a lot following your codes, comment as well as all the explanation.

  • @coltonwilliams1565
    @coltonwilliams1565 4 года назад

    This was incredibly helpful. Thank you Brad

  • @NafeoJoy
    @NafeoJoy 4 года назад

    You are amazing Brad!

  • @chammidhan
    @chammidhan 5 лет назад

    Awesome tutorial. Simple and to the point!

  • @ashutoshnayak609
    @ashutoshnayak609 6 лет назад

    Wait 2 videos at the same time , I am on cloud 9 , thanks Brad.

  • @abbie3156
    @abbie3156 5 лет назад +2

    Is there any technology you don't know! Excellent tutorials. keep up the good work.

  • @emdirtyyo1827
    @emdirtyyo1827 4 года назад

    I'm simple guy, when I see Brad's video, press thumb up button

  • @onurtravels
    @onurtravels 4 года назад

    Doing the ssh configuration is also showing the process, nice 🙂

  • @anandanhumanoid
    @anandanhumanoid 4 года назад

    Great learning,Thanks for sharing Brad.

  • @NoNameChannelSigma
    @NoNameChannelSigma Год назад

    perfect lesson, thank you for your efforts

  • @derwt7
    @derwt7 6 лет назад +2

    omg thanks for taking the time to do this

  • @ivan-the-l
    @ivan-the-l 3 года назад

    Thx a lot for your tutorial! It helped me a lot with my college assignment :)

  • @usmanmudasser5359
    @usmanmudasser5359 5 лет назад

    Another great video. Man you are the best. Please add more docker networks and security related videos

  • @fenilli
    @fenilli 5 лет назад

    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.

  • @macorreag
    @macorreag 4 года назад

    Information very important in 2:39 to solve problems to connect Nodejs and MongoDB.

  • @diallomamadou258
    @diallomamadou258 6 лет назад

    Always amazing content Brad, I'm so glad to be one of your subscribers. Thank you very much

  • @bulldog2024
    @bulldog2024 3 года назад

    Is there a way to display a maintenance page if the containers are not working?

  • @factionzer0
    @factionzer0 6 лет назад +1

    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?

  • @InphaMyllz
    @InphaMyllz 5 лет назад +2

    how do you get this to automatically sync with github? or do we need to manual git pull and do another docker-compose up every time?

  • @joelpeltonen7149
    @joelpeltonen7149 6 лет назад +3

    Hey! An elasticsearch video would be great!

  • @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!

  • @bajpaimahendra3832
    @bajpaimahendra3832 3 года назад

    we should install new nodejs module insede container or host machine ?

  • @nicholaspappas9351
    @nicholaspappas9351 6 лет назад

    Awesome video. I'd love to see some more docker videos!

  • @indrajeetsohoni4315
    @indrajeetsohoni4315 4 года назад +1

    I need help, when I hit localhost after docker-compose up it just keeps loading the page

  • @jaimeeduardo159
    @jaimeeduardo159 4 года назад

    If you make changes you should use docker-compose build to see your changes

  • @erickloningo2252
    @erickloningo2252 4 года назад

    you are a life saver. thanks alot man. really helped me alot

  • @GfastGao
    @GfastGao 4 года назад

    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 4 года назад

      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.

  • @lazarpetrovic5390
    @lazarpetrovic5390 5 лет назад

    The funniest part of this is Brad forgetting his git password. It's funny because it's relatable

  • @underrated_mono9770
    @underrated_mono9770 3 года назад

    Question:
    Do I have to build image and docker-compose every time files are modified when developing the project?
    I have no experience of development using Docker.

  • @limaand2009
    @limaand2009 4 года назад

    Within a single server can I have several separate containers?

  • @thecondor5488
    @thecondor5488 5 лет назад +1

    So glad you messed up with the SSH it definitely helped!! :D

  • @DevangPatil
    @DevangPatil 5 лет назад +1

    Can we use heroku than digital ocean?

  • @billpliske
    @billpliske 5 лет назад

    Very helpful, Brad. Great job!

  • @amastou4634
    @amastou4634 5 лет назад

    I don't understand why use Copy for package.json as it seems to be already at working directory. Thanks for reply

  • @gigabyte2053
    @gigabyte2053 5 лет назад +1

    you are amazing dude i have learned so much from you be happy for what you do for world bro

  • @beyondthehorizon94
    @beyondthehorizon94 5 лет назад

    You made it look very simple, thx.

  • @rroblesgo
    @rroblesgo 6 лет назад

    Excelent as always Mr. Brad !!

  • @nilsdomin3120
    @nilsdomin3120 6 лет назад +3

    Great, thanks! Suggestion: You could make a tutorial with the MERN stack, e. g. with your Devconnector app.

  • @kirtho07
    @kirtho07 2 года назад

    Hello Sir
    your lectures are awesome! Thank you
    I

  • @wchorski
    @wchorski 3 года назад

    so a password and user was not set on the MongoDB image? What would be the enviromnents for the docker-compose.yml file to add 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

  • @sprintwithcarlos
    @sprintwithcarlos 5 лет назад

    I used Now for Docker deploy but in version 2 they eliminated support... Which other option you recommend to test for free? Thanks! All your tutorials are awesome, right to the chase without blah blah

  • @moonyyy9093
    @moonyyy9093 4 года назад

    If I use Docker, do I need to create env variables for dev and production?