When would you want to use docker and docker-compose on your projects?

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

ความคิดเห็น • 72

  • @ToddDunning
    @ToddDunning ปีที่แล้ว +23

    You do an uncannily good job at making frighteningly complicated stuff simple, and just as importantly giving it real context so we know where the hell to put it.

  • @tacowilco7515
    @tacowilco7515 8 หลายเดือนก่อน

    We started to use docker compose on our project and this simplified our life so much. Thank you for this overview, you are always on point, no blah blah blah.

  • @LordFalkord
    @LordFalkord ปีที่แล้ว +6

    I used docker/docker-compose at work for like 2 years. The project i was working on was quite big with a lot of services, so I had quite a lot of containers open. The main issue I had was about performance. When you use Chrome, VSCode, a hot-reload React service + all of your docker containers (which run under a virtual machine under the hood), my Macbook Pro was struggling so much. I just removed docker, and oh my god my macbook is so fast now. I finally prefer managing my own tools versions (with brew, nvm etc...) rather than having a slow Macbook Pro. If I had a Linux machine I would still use docker tho (as it doesn't require a VM) !

  • @JegErN0rsk
    @JegErN0rsk ปีที่แล้ว +3

    As an aspiring developer these videos are invaluable. Thanks!

  • @eshw23
    @eshw23 ปีที่แล้ว +1

    Thanks a lot for responding to everyone in the comments including me Cody, helps us out a lot when you give back to the community to help us grow

  • @neontuts5637
    @neontuts5637 ปีที่แล้ว +2

    Thanks for sharing. Docker is on my learning list this year.

  • @Yusuf-ok5rk
    @Yusuf-ok5rk 10 หลายเดือนก่อน

    thank you for the content cody. your videos really give a good perspective when i need it. it is like having a senior developer that i can consult to, or maybe better than that.

  • @Pyrospower
    @Pyrospower ปีที่แล้ว +5

    Nice video! I haven't really dug into it yet, but I think using multi-stage builds might be interesting to reduce complexity and optimize the Dockerfile

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว +2

      I’ll have to look into that

  • @hunterbidenafterlife
    @hunterbidenafterlife 11 หลายเดือนก่อน

    been learning docker and it's pretty cool, especially when using docker-compose, the only real thing I dont like is dealing with when your node_modules change or update, usually involves deleting the node_module volume and container and rebuilding, not terrible but definitely an annoying flow breaker if your dependencies change a lot.

  • @gilney.mathias
    @gilney.mathias ปีที่แล้ว +1

    I'm playing around with Spring Boot + Microservices and i'm using docker compose too... It was a fucking pain in the ass to set everything up, but it is really satisfying to do 1 command and get 19 containers up and running 😅

  • @seblaise94
    @seblaise94 ปีที่แล้ว

    Elite🎉🎉, Real world dev experience 🙌🏾

  • @bulelanibotman
    @bulelanibotman ปีที่แล้ว

    awesome video! just clear and straight forward explanation & easy to understand

  • @devippo
    @devippo ปีที่แล้ว +1

    Thanks Web Dev Cody. I'm using Docker more often lately but only when I deploy.
    The tricky part I'm trying to wrap my head around is when we develop locally is the typescript building and updating the docker image with each file save?
    Thanks so much for all your videos.

  • @ArynKr
    @ArynKr ปีที่แล้ว

    You made it really simple to understand. Great video. 🔥

  • @SeibertSwirl
    @SeibertSwirl ปีที่แล้ว +2

    Good job love ❤

  • @karstr770
    @karstr770 3 หลายเดือนก่อน

    7:13 It does not ignore the files. Due to the first volume mount, it will copy over everything from the host to the container, including your node_modules, but it will overwrite /home/app/node_modules in the container because you create anonymous volume on that path. Anyway, I don't think this is the correct way to do it. You should create .dockerignore to tell which files you don't want to be copied to the container.
    ---
    I like that multiple services can be started easily through Docker Compose, but my main issue with it is that in order for static analysis to work properly in the IDE, you still need to install packages (e.g. node_modules, .venv) in your host machine, which to some extent defeats the purpose of containerization. Bind mounting them to host, as was mentioned in the video, is not a good solution, because of potential differences between versions and operating systems. Of course, one can work without static analysis, but it helps immensely. Yes, I am aware of Dev Containers in VS Code, but it feels restrictive to bind the project to specific IDE. Anyway, does anyone know a solution for this?

  • @johnpaulpineda2476
    @johnpaulpineda2476 ปีที่แล้ว +2

    What if, you create a complete next13 or t3 app with docker and docker-compose??? That would be a banger tho.

  • @igboanugwocollins4452
    @igboanugwocollins4452 ปีที่แล้ว

    Thank you very much!

  • @nested9301
    @nested9301 ปีที่แล้ว

    i finally understand what docker really is

  • @StellarStoic
    @StellarStoic 10 หลายเดือนก่อน

    As I thought, it's not easy :) I was so happy building a web app in local environmental until I needed some help and friend told me just send me a docker file and now I get to realization if you stop being a solo dev you obviously need to learn docker or whatever the other containers are called.
    I feel like at the beginning of my coding journey. I'm clueless 😂

  • @ljnoble5171
    @ljnoble5171 ปีที่แล้ว +1

    When would you use `docker-compose` vs `docker compose` please?

  • @MarkDeibert
    @MarkDeibert ปีที่แล้ว +2

    Great vid, exactly what I was looking for. Trying package up my app like this with Docker. Mainly for easier deployment. Side question: Is that gorgeous theme Catppuccin?

    • @MarkDeibert
      @MarkDeibert ปีที่แล้ว +2

      Oh Ok I see in comments below, not Catppuccin. I def like it. It's Catppuccin'ish 🙂

  • @navjotsingh2457
    @navjotsingh2457 2 หลายเดือนก่อน

    Ty

  • @masoiaXL
    @masoiaXL ปีที่แล้ว +1

    Cool video! Did you look into the `networks` property of a service? That makes it possible to sort of group services together that can only communicate with each other if they are in the same network. Could apply to your mongo db services.

  • @webdeveloperninja9220
    @webdeveloperninja9220 ปีที่แล้ว

    Good explanation

  • @mrirror2277
    @mrirror2277 ปีที่แล้ว +1

    Hi, great video! Say for a completely new dev with a new-ish machine (like an almost no tooling Windows machine), does the dev only need to install Docker, clone the repo and that's it? No other local dependencies needed.

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว +2

      That’s the goal yes, it’s hard to get perfect sometimes

    • @mrirror2277
      @mrirror2277 ปีที่แล้ว +1

      @@WebDevCody I see, that's really cool! (well assuming everything goes well hahah..) Keep up the good stuffs :)

  • @LegendKiller977
    @LegendKiller977 ปีที่แล้ว

    Love your videos, very helpful and to the point! BTW, what's the VS Code theme you use?

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว

      bearded theme stained blue

  • @supercrunch3367
    @supercrunch3367 ปีที่แล้ว +2

    will you be integrating nginx with it? would love a tut too

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว +3

      No, I deploy my api to aws lambda so I don’t need nginx

    • @supercrunch3367
      @supercrunch3367 ปีที่แล้ว +1

      @@WebDevCody i see

    • @FunkyToe369
      @FunkyToe369 ปีที่แล้ว +2

      its not too hard to integrate nginx. can just add it as a service to your docker-compose, expose it at port 80 and internally it has no issues routing to your other services

    • @supercrunch3367
      @supercrunch3367 ปีที่แล้ว +1

      @@FunkyToe369 when u finally integrate it, how do you go about the deployment to AWS? Is it the same process? Cant seem to wrap my head around it.

    • @danielchettiar5670
      @danielchettiar5670 ปีที่แล้ว +1

      ​@@supercrunch3367I have a microservices project, and I'm on the free tier of AWS.
      On my EC2, my nginx docker compose service listens on port 443&80. Port 80 requests are redirected to 443.
      It's pretty easy, it's not hard actually. You just have to get your code on your EC2, and then it's just as you would use any other machine, through the terminal.

  • @TheSimslash
    @TheSimslash ปีที่แล้ว +1

    You don't have HMR with this architecture do you ? Saving src files from your back/ui won't refresh everything will it ? Will you have to spin up everything again or is there a binding between local files and docker files or something ?
    If so dev experience might not be best if you have to wait a lot of time to to refresh with your code

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว +2

      You can use volume mounts so when you edit files in vscode it’ll refresh

  • @kuroisan2698
    @kuroisan2698 ปีที่แล้ว

    do you think about making some graphql tutorials
    especially dealing with files

  • @filoktetesbror
    @filoktetesbror ปีที่แล้ว +1

    What about if you would want to deploy all of them to lets say, Azure/AWS, do you need a separate dockerfile for each project?

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว +1

      If you’re running your app inside a container, it’ll work on any platform

    • @filoktetesbror
      @filoktetesbror ปีที่แล้ว +1

      @@WebDevCody Gotcha, a great thanks for these videos, amazing content and learning a ton, wish you all the best!

  • @ahmedbalaid7464
    @ahmedbalaid7464 ปีที่แล้ว

    I am looking for a program that will be a link between the worker and the store, and I am the one who controls them. Can I understand what kind of program

  • @shynsky
    @shynsky ปีที่แล้ว

    Great explanation as always 👏 Not sure if problem with ipad, but I didn't manage to subscribe 🧐

  • @rakhisingh9797
    @rakhisingh9797 ปีที่แล้ว +1

    Btw how you store your jwt token in local store or in http cookies 🙂

  • @epicujjwal
    @epicujjwal ปีที่แล้ว

    does this have hot reload features?

  • @nikhil182
    @nikhil182 ปีที่แล้ว +1

    One of the reasons why I avoid using docker is it consumes so much RAM, it makes development very difficult.

  • @chriskeo392
    @chriskeo392 ปีที่แล้ว

    Why dont u habe multiple dockerfiles for backend , frontend, db? Help!!?!?
    U explained so much thank u

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว +1

      You could do that if you want. That would be more useful if your backend was in java or some other language. When everything is nextjs, it doesn’t make as much sense

    • @chriskeo392
      @chriskeo392 ปีที่แล้ว

      @@WebDevCody that makes much sense! Love the content. Straight to the point

  • @Yunyun-o6m
    @Yunyun-o6m ปีที่แล้ว

    hi may I know why im having an issue when running a "docker-compose up" . the error is " services.nginx must be a mapping"

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว

      I'm not too sure, I don't even recall using nginx in this video

  • @kritsrijakkot9175
    @kritsrijakkot9175 6 หลายเดือนก่อน

    I have questions. If I using t3 stack can I create docker-compose for build nextjs app and db in the docker compose file. You have example for me to do that or explain to me. Thank you

    • @WebDevCody
      @WebDevCody  6 หลายเดือนก่อน

      I don't have an example. Do you mean hosting using containers?

    • @kritsrijakkot9175
      @kritsrijakkot9175 6 หลายเดือนก่อน

      @@WebDevCody yes. Possible to use 1 docker compose on prod and everything work?

    • @kritsrijakkot9175
      @kritsrijakkot9175 6 หลายเดือนก่อน

      I use VPS (digitalocean droplet)

  • @dermachedjamel8970
    @dermachedjamel8970 ปีที่แล้ว

    what icon set does he use for VS code ?

  • @shakapaker
    @shakapaker ปีที่แล้ว

    Thanks! Why 'yarn' instead of 'pnpm'?

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว

      no clue, just picked one honestly. is pnpm better?

    • @shakapaker
      @shakapaker ปีที่แล้ว +2

      @@WebDevCody From what I understand, for managing node_modules, `pnpm` uses hard linking and symbolic linking to a global on-disk content-addressable store. This gives you the benefits of far less disk space usage, while also keeping your node_modules clean. And it also seemed to me that it installs dependencies much faster. And also supports workspaces.

  • @jora5483
    @jora5483 ปีที่แล้ว

    Random question. When it comes to deploying it on cloud you upload the image created by docker or choose the platform and build the app on cloud?

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว +1

      either, but usually your ci pipeline would build you image, test it, then push it to docker hub or ecr if it seems good

    • @jora5483
      @jora5483 ปีที่แล้ว

      @@WebDevCody great, thanks.

  • @complikatd
    @complikatd ปีที่แล้ว

    ternimal

  • @mrbananaaa69
    @mrbananaaa69 ปีที่แล้ว +2

    hi! I found a problem accessing your newsletter website, can I send the screenshot to Discord?