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

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

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

  • @pojomcbooty
    @pojomcbooty 3 года назад +12

    The clarity !! All tutorials should be like this. From split-screening, to having individual lines of code appear rather than each character, thus is just so clear to my brain!! Bug kudos ! Subscribing

  • @befrog57
    @befrog57 3 года назад +39

    Amazing video! You explained everything in a very understandable and clear way without oversimplyfing it. Love it

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +2

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

    I love the pace that you work through things, no filler and everything I need as a devops newb.

  • @Gwittdog
    @Gwittdog Месяц назад

    This video is freaking brilliant. High level yet concise. You have my bell icon being rang.

  • @shivangitomar5557
    @shivangitomar5557 3 года назад +1

    I finally understood after watching 10 other videos! You are amazing!!

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

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

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

    We have to give a comment for appreciation such an amazing content. So organized, easy to understand.

  • @Rodrigo-lq2iy
    @Rodrigo-lq2iy 3 года назад +2

    It's amazing, i feel i learnt way more than 6 minutes. Totally subscribing and recommending this channel! Thank you very much!!

  • @BulletSP
    @BulletSP 6 месяцев назад

    thanks man for saving our time, u explained it very crisp and concise and fully comprehensible

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

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

      Amazing! Welcome to the team! 👋👋👋
      I have a few other Docker videos as well if you want to check those out.

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

    Thanks a lot mate, I was needing this for a project, great job, please keep rocking!!!

  • @sureshkrishnan83
    @sureshkrishnan83 3 года назад +2

    I probably end up watch all your video by end of this weekend . 😀..thanks

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +3

      Epic!
      Depending on which order you watch, you will see the production quality going ⬆️ or ⬇️ and my beard growing or shrinking 🧔

  • @sriraghariharan130
    @sriraghariharan130 3 месяца назад

    Short and knowledge heavy ❤

  • @chiragkhachane9739
    @chiragkhachane9739 3 года назад +1

    Hey man this video was just the thing I was looking for. Solved some of my queries to! Thanks for the tutorial.

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

      Awesome! Are you building something with docker compose?

    • @chiragkhachane9739
      @chiragkhachane9739 3 года назад +1

      @@DevOpsDirective Yeah. I am building my Undergraduate Project with Docker and MERN stack.

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

    this is awesome stuff! was able to build my frontend and backend images and execute them with docker-compose. thx!

  • @chiefterribleteacher8687
    @chiefterribleteacher8687 3 года назад +1

    Concise and super helpful, thanks for sharing!

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

      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!

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

    Well-made, high-quality video. Subscribed. Well done!

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

    Wow, amazing video, and congratulations on 500 subs! 🙏

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

      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!

  • @farzadsole3784
    @farzadsole3784 3 года назад +2

    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  3 года назад +2

      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!

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

    THIS MOVIE ACTUALLLY WORKS! Tahnk you very much, now i get it :D

  • @MJ-ih1yu
    @MJ-ih1yu 3 года назад +1

    Great explanation! Keep teaching👌

  • @LeviAckerman-pl9um
    @LeviAckerman-pl9um 3 года назад +1

    Short informative and simple, thank you for sharing. here's a sub

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

    Thanks. This tutorial clarified my mistakes. Amazing Video

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

    Wow!! Great content. simple and well explained. Thank you so much.

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

    "Just keep building"
    Subbed. Thanks

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +1

      It's the only way to get better! Welcome to the team!

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

    Awesome I'm loving your videos! Thanks!

    • @DevOpsDirective
      @DevOpsDirective  2 года назад +1

      Great -- Thanks for letting me know! Comments like this make it worth the effort!

  • @MjCarnaje-jd5ut
    @MjCarnaje-jd5ut 2 года назад

    THANK YOUU!! very understandable!

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

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

    Very simple precise and perfect you are awesome brother

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

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

    MAN YOU ARE TOO MUCH GOOD

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

    Wow this is really helpful!

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

    Really great concise video

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

    Really loved the video !! Helped me a lot thanks !

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +1

      Amazing -- thanks for watching and for letting me know!

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

    nice and clear toturial by the way thank you

  • @darwish-mammo
    @darwish-mammo 3 года назад

    you're a great guy mate! thanks for the video

  • @pedruchu259
    @pedruchu259 3 года назад +1

    You are a God, thanks so much, you saved my life!

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

    Thank you! Awesome! Greetings from Brazil :)

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

    Awesome! Amazing explanation, thank you!

  • @DevOpsDirective
    @DevOpsDirective  4 года назад +2

    Another new software RUclipsr ItGuyMichal coincidentally released a docker-compose video yesterday as well (ruclips.net/video/UBFiCfbRykE/видео.html)
    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!

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

    this is one great video man, keep it up.

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

    What a great video!!!

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

    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

  • @ced4841
    @ced4841 3 года назад +1

    Good Video, pleasant voice!

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

    Perfect!!!
    Thank you very much.

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

    simple and clear.great !!!

  • @meshavegas
    @meshavegas 7 месяцев назад

    I have a question if instead of using the network I use nginx is a correct practice?

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

    I would suggest to keep close the database mount, not using named volume but directly storing db data into folder

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +1

      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!

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

    thanks, short and to the point

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

    ERROR: In file './docker-compose.yml', service 'image' must be a mapping not a string

  • @HoaLe-jx3gg
    @HoaLe-jx3gg 3 года назад

    Very useful!

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

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

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

      @@DevOpsDirectiveOk. i understand.Thank you so much !!!

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

      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!

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

    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

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

    Excellent 👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻

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

    Excellent!!thank!

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

    How to change ip address with docker-compose instead of
    hardcoding

  • @jackedelic9188
    @jackedelic9188 3 года назад +1

    I am confused, so before using docker-compose up, do we need to separately build the images for client and server?

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +1

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

      @@DevOpsDirective That absolutely helps :) Thanks for clearing my doubt

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

      @@jackedelic9188 Great! Thanks for watching the video and being a part of the community.
      Keep the comments and questions coming!

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

      @Mr 3xclamtion Good point!

  • @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: ruclips.net/video/DftsReyhz2Q/видео.html
      You can do this in the docker run command or with docker-compose (docs.docker.com/compose/environment-variables/#the-env_file-configuration-option)

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

      RUclips comments are very cumbersome for technical discussions, but if you want to join the channel discord community someone can probably help! discord.gg/ExrENts5CT

  • @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  Год назад +1

      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!

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

      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.

  • @Chris-mr8qm
    @Chris-mr8qm 2 года назад

    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  2 года назад +1

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

      @@DevOpsDirective Thank you for your answer. last one, is docker compose an orchestration then? how does it defer from kubernetes?

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

    Great content, thank you.

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

    What was it that made Docker and the whole idea of containerization possible?

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

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

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

    ❤️🔥

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

    Do I need to understand coding part for building thia docker compose file

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +1

      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)

  • @kenny8422
    @kenny8422 3 года назад +1

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

      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!

  • @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 (ruclips.net/video/DftsReyhz2Q/видео.html)
      I hope that helps!

  • @MuhammadBilal-cq6tp
    @MuhammadBilal-cq6tp 2 года назад

    Good Content.

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

    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  3 года назад +1

      As configured in the video you would have to rebuild the image first. In my recent livestream (ruclips.net/video/DftsReyhz2Q/видео.html) I showed how to mount the source code into the container using a volume so that changes can be reflected immediately!

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

      @@DevOpsDirective thankyou, will look forward for it

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

    Thank you for this video. So how do you scale your containers if you want to scale after using docker compose?

    • @DevOpsDirective
      @DevOpsDirective  Год назад +1

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

      @@DevOpsDirective Ok I asked because I'm thinking of how companies scale their container databases

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

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

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

      @@DevOpsDirective +1 on this, would love to see how to make a set up like this production ready

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

      @@bryanmullen4462 Awesome -- thanks for the input. I will put it into the backlog of future video ideas!

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

    What should we care if we want to use this docker compose file in production mode?

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

      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

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

    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  3 года назад +1

      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

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

      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!

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

    If I'm using a .env with mongo db atlas uri what should I do?

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +1

      Hi @Alberto! In this video I configure this app to use Atlas for the DB and use a .env file ruclips.net/video/DftsReyhz2Q/видео.html
      Hopefully it helps!

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

      @@DevOpsDirective thanks a lot!

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

    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  3 года назад +1

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

      @@DevOpsDirective Thank you very much! I will do more studying on it

    • @DevOpsDirective
      @DevOpsDirective  3 года назад +1

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

      @@DevOpsDirective I will do!

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

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

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

      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!

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

    So basically docker compose creates a container with several images? Or does it still create 3 sepparate containers?

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

      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!

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

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

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

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

    Do you have an example of a docker compose for the ml stack?

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

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

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

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

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

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

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

      ​@@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  3 года назад +1

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

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

    excellent!!

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

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

      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)

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

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

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

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

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

      @@DevOpsDirective Thank you so much :)

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

      @@michellegburgosf You are welcome -- Let me know if you run into issues getting it up and running!

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

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

      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!

  • @Quick_Code
    @Quick_Code 11 месяцев назад

    super easy

  • @maxkinli
    @maxkinli 6 месяцев назад

    You can’t just run react app in webpack dev server and say this is your react docker container

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

    great

  • @md.fazlulkarim8847
    @md.fazlulkarim8847 3 года назад

    Awesome

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

    ty.

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

    awesome

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

    whats the point any of this

  • @maxkinli
    @maxkinli 6 месяцев назад

    I’m in shock. 50 y.o guy teaching the wrong stuff… this is the real problem. Why this even exist

  • @andji8709
    @andji8709 2 года назад +1

    Amazing video! You explained everything in a very understandable and clear way without oversimplyfing it. Love it