The Best Way To Deploy In 2024 (feat. Docker, Rust, and Language Models)

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

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

  • @bobfearnley5724
    @bobfearnley5724 Год назад +9

    I am so proud of your channel. I have been following since you started and I can see the massive progress! :D

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

      thank you so much! it's great to hear things like this, it motivates me so much 😎

  • @jembishop3509
    @jembishop3509 10 месяцев назад

    Great video!

  • @CodingWithLewis
    @CodingWithLewis Год назад +3

    15:55 You said it's not blazingly fast but that looks pretty damn fast to me! Any recommendations what VM type you would run this on?

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

      Yeah I should have left the clip at normal speed, at least for a few seconds 😎 you can sort of see the actual speed in the few seconds where I'm speaking as the text is coming through. Also I'm really stoked to see that you watched this, I really enjoy your content!!

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

      As for recommendations for VM to run this on, I'd probably start with one of the g* instances like a g5. I think the inf instances may be even more ideal from a hardware perspective, but I'm not sure if there is software support for this type of stack on those

  • @IcarusSparry
    @IcarusSparry Год назад +6

    01:20 "docker init" requires docker desktop. Whilst it is free for many people you need to look at the license and make sure that you are not requiring your company to subscribe to professional license fees.

    • @codetothemoon
      @codetothemoon  Год назад +2

      ahh yes thanks for pointing this out, I should have mentioned it!

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

    I DIDNT KNOW YOU COULD DO docker init and the Dockerfile is made for you. I WAS BANGING MY HEAD TRYNG TO FIGURE OUT WHY MY DOCKERFILE WASNT WORKING. THANKS SO MUYCN

  • @bayoneta10
    @bayoneta10 Год назад +16

    Great video! I noticed that the entire src directory and the package.json file are being copied over before executing npm install. A possible improvement could be to first copy only the package.json file, run npm install, and then copy the rest of the source code. This way, the installation step would be cached, making the build process more efficient, especially when changes are made to the src directory but the dependencies remain the same. After that, something similar could be done with npx tailwindcss, but I have to say that I am not sure about that

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

      This should be pinned.

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

      whoa thanks for pointing this out! sounds like a fantastic optimization - will give it a try!

  • @sachaw100
    @sachaw100 Год назад +6

    Good video, but I think you should have intruduced it from the standpoint of using OCI containers and that docker is just one runtime, not that it is the tooling of choice. Containerising your applications so they can be run under any OCI runtime (kubernetes, podman, etc) is where the real value lies, not vendor lock-in to one platform.

    • @codetothemoon
      @codetothemoon  Год назад +4

      thanks for the feedback! I definitely made a point to emphasize that although I used AWS ECS as an example, once you have an image you're free to use pretty much any cloud platform. But to your point, instead of saying "any platform that supports Docker images" I probably should have said "any platform that supports OCI images".

  • @rafaelgomes3054
    @rafaelgomes3054 Год назад +3

    Loved the video. I know we don't often need scaling but it is good to see how to get it working.

    • @codetothemoon
      @codetothemoon  Год назад +4

      thanks, glad you got something out of it! i think it makes sense to make a habit of building for scale, even when you don't think you'll need it. because it actually doesn't cost any extra - just a few extra things to consider

  • @a314
    @a314 Год назад +9

    You can use alpine images to both speed up your build, runtime and as well as patch any CVE that gets published. Combined with Rust, the resulting docker image size will be 20+MB which is 7x smaller than the Debian based image.
    Fwiw, Debian is pronounced Deb-Ian, not Dib-Ian. Ian Murdock created Debian in1993. The word "Debian" was formed as a portmanteau of the first name of his then-girlfriend (later ex-wife) Debra Lynn and his own first name.

    • @codetothemoon
      @codetothemoon  Год назад +3

      thanks for pointing both of these things out! I stuck with Debian for the video mostly because that's what docker init gives you by default - probably not the best reason

    • @maximotejedapozo9335
      @maximotejedapozo9335 Год назад +2

      Docker stick to debian due to c lib compatibility issues, I think by default Alpine use musl which bite me in the past

  • @L0wPressure
    @L0wPressure Год назад +2

    Wait your split keyboard is totally wireless. It looks awesome, do you have a review of it?

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

      yep, I do! it's actually the video immediately preceding this one: ruclips.net/video/PFFa3h7eLWM/видео.html

    • @kai-.-man
      @kai-.-man Год назад

      He made a recent video (9 days ago)

  • @flwi
    @flwi 10 месяцев назад

    Nice video. Clever approach of using a specialized build image just for the tailwind stuff. Haven't thought about it and will use that for sure!
    I'm currently learning rust and having a good time. Due to the interactive rustlings tutorial I get the same joy and flow as back in the days where I was learning scala with the official coursera course that had automated grading of the excercises

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

    Great content, as always! Thank you.

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

    Wait, wait, do you have a glove 80 gathering dust in a shelf??? Why?

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

      that's actually one of the boards MoErgo sent me to compare the different switches. I have to send it back but I'm waiting on the shipping info, so I decided to make it part of the set in the meantime 🙃

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

      @@codetothemoon , that was a speede response. After the initial shock I saw you were using a glove 80 during the video, so everything is fine 😄

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

    loved it! ty

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

    Great video. I had just did the same thing recently on AWS with my Rust Docker. Would really liked to had know that 'Docker init' lol. As I struggled with my Mac M1 compiling to AMD64 and dealing with the AWS exec error I got haha. Its always a video after the fact. ;) But I have followed you for a while. Thanks for this new addition really helpful. Cheers.

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

      thanks! Docker init is indeed pretty useful, I didn't know about it either until very recently. really happy to hear you're getting something out of the videos!

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

    Does rust backend app need crate or anything else for deployment?(some thing like gunicorn for python)

    • @flwi
      @flwi 10 месяцев назад

      No, rust binaries bring everything they need (afaik). The don't need any runtime/vm. That's one of the big benefits of rust imo.
      Not an expert, since I only learned coding in rust last week.

  • @twenty-fifth420
    @twenty-fifth420 Год назад +1

    Woah hold on there moon boy! Now I may be super high, but I have enough on my plate coding and speedrunning ruby with my personal project and website. 😂 But I will watch your video because I love you❤
    Take it easy, I just like the whale. I do not want to ride the whale yet. 😂 _I admit though deploying to docker is my preferred solution of choice_
    (But after Ruby is Nim and Haxe, I know strange order but I rolled 20 languages in 3 ‘random’ lists. I picked 20 and thought they looked pretty and plucked them randomly and going with it.)
    Go was on the first list. But I have it fourth. And I am in ‘no’ rush until I hit week 4. I am scripting high after all 👌

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

      this is one of my favorite comments of all time lol

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

    Great video as always . it seems u updated doom emacs and did not run nerd font install (thats why your modeline looks like crap) . Love u!

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

      haha thanks for pointing this out, I didn't even notice! lol

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

    great video .. thanks

  • @renancidale9210
    @renancidale9210 11 месяцев назад +1

    love it.

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

    Pretty good content

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

    Oi, you docker init?

  • @Hacking-Kitten
    @Hacking-Kitten Год назад +2

    ecs does not scale to zero, right? Adds up for lots of side projects.. From the title of the video I expected a deployment guide, not docker..

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

      Thanks for the feedback! I believe it can if you use 1 free tier ec2 instance. You could probably deploy multiple projects to it, thought I'm not sure what the best approach for that would be. Re: deployment guide, you mean more details on the building and deploying on a platform like ECS?

  • @SR-zi1pw
    @SR-zi1pw Год назад +1

    Nice video

  • @Sahil-a-vim-user
    @Sahil-a-vim-user Год назад +1

    It's not d-bian it's flipping DEB-IAN 😭😭
    great vid btw

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

      So I’ve learned :) you can’t imagine the comments about my pronunciation of “enum” 😆

  • @imichael.
    @imichael. Год назад

    Appreciate the multi-stage builds, but your Dockerfile seems like a junk drawer to me. This is a "God" image that is completely unfocused and not easy to maintain. Consider breaking these up into separate Dockerfiles instead.

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

    Seriously docker sucks. It's great that containerization was popularized, but docker sucks.

  • @wgolyoko
    @wgolyoko Год назад +22

    I hate these types of video. 99% of use cases do not need any scaling, and a single AWS instance will be able to handle everything. If your app somehow ends up actually needing scaling, you'll be making well enough money to do so at that time.

    • @leifelliott1500
      @leifelliott1500 Год назад +6

      Never hurts to understand containerized scaling. But yeah I mean I deploy my projects in a single DigitalOcean Droplet lol.

    • @codetothemoon
      @codetothemoon  Год назад +22

      thanks for the feedback! would the "money you'll be making" lend itself to an approach different than the one described in the video?

    • @georgehelyar
      @georgehelyar Год назад +13

      Even if you don't need scaling, containers are amazing for any kind of deployment.
      You build it once then you can run it on any OS, in dev or in production, and can be confident that it will work the same in all of them, and because they are so ubiquitous, a lot of cloud services will let you just use a docker image for a really easy deployment.
      Each line also adds a layer so you get incremental builds for free. If it doesn't change, it can just use the cached layer. Just make sure to put the slow things that rarely change at the top.
      Kubernetes is often overkill though, until you actually need the scale.
      Depending on how you host it, you can also scale down to 0 so that it doesn't cost anything when it isn't being used.

    • @thanatosjamie7663
      @thanatosjamie7663 Год назад +2

      @@georgehelyar That's another issue with this approach specifically. Even when it's scaled down to zero, AWS ECS and ECR are not free.
      The load balancer he created has a fixed cost even if you have zero instances running.

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

      ​​​​​@@thanatosjamie7663yea like I said it depends how you host it.
      My point was really just that containers are useful for any kind of deployment, not just for high scale, and that scaling can also mean scaling between 0 and 1, when you're talking about low scale.
      This can be cheaper than running a VM that sits idle most of the time, but again it depends how you host it, and there are a lot of options for that on both sides.
      The main reason to use containers is not cost or scaling, it's reproducable deployment. Cloud does the scaling (and this costs the money), containers make it portable and easy to deploy and know that it will work the same no matter how you host it.

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

    Your deployment is not the ideal case for deploying rust apps. Aws instances are so expensive and docker also slows down rust applications. So your video isn't helpful for actual rust developers. A usually serious rust developer would want to create his own remote server and probably want to use nginx kinda server to run his server, because if you don't want to absolute best performance you don't write a web server with rust.
    So because of that reasons your video is abstract from reality. If you want to deploy that website to more realistic environment i would really appreciate it.

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

      Thanks for the feedback! Where would you create this remote server and how would you scale horizontally? Also how would you use nginx to serve a Rust application? Always looking for solutions cheaper than AWS!

  • @eli1882
    @eli1882 8 месяцев назад

    Who tf says deebian?