Run your Next.js app on Cloud Run

Поділитися
Вставка
  • Опубліковано 8 вер 2024

КОМЕНТАРІ • 40

  • @rgcottrell
    @rgcottrell 3 місяці тому +7

    I actually just got a dockerized Next.js starter app deployed to Cloud Run yesterday. It took me a lot longer than the four minutes needed in this video. :-)

    • @TheMomander
      @TheMomander 3 місяці тому

      Congratulations on deploying your app, even if it took longer than in the video. I'm sure it will be quicker next time 🙂

  • @LeonBlade
    @LeonBlade Місяць тому +2

    This video is great for showing just how easy it is to get an app up and running in no time at all.

    • @TheMomander
      @TheMomander Місяць тому

      Happy to hear that the video was useful to you!

  • @jorgedominguez3972
    @jorgedominguez3972 2 місяці тому +2

    Thank you, Martin! @TheMomander This video perfectly captured everything you described to me at the Firebase booth at Google Cloud Next. It's truly amazing. I never expected the deployment of a Next.js App to be this smooth.

    • @TheMomander
      @TheMomander 2 місяці тому +1

      Happy to hear that, Jorge! It was very nice meeting you at the Cloud Next conference. I can't wait to see what cool apps you build!

  • @obtr7419
    @obtr7419 3 місяці тому +1

    Martin, I've seen a video of the installation with “Vite” before. But I definitely needed NextJS. I've been experimenting with it for a few days, but I had problems with most of them and couldn't make any progress for the project. Thank you both very much for this video. Also, we are waiting for the repo :)

    • @TheMomander
      @TheMomander 3 місяці тому +1

      Sorry, I forgot to include the link to the repo! I asked our publishing team to add it to the video description.

    • @obtr7419
      @obtr7419 3 місяці тому

      @@TheMomander That's great. Thanks for the feedback.

    • @TheMomander
      @TheMomander 3 місяці тому +1

      The link to the repo has been added to the description. Thank you for letting me know it was missing!

    • @obtr7419
      @obtr7419 3 місяці тому

      @@TheMomander You're welcome and thank you very much.

  • @maureljulien
    @maureljulien 2 місяці тому +2

    Hey many thanks :)
    I've been able to deploy my NextJs webapp super fast following your video ;)
    I am now wondering if I can follow the same steps to deploy a React (TS+Vite) web application ?

    • @TheMomander
      @TheMomander 2 місяці тому

      Yes, you can! I shot a video about this last year. Search for "Run your React app on Google Cloud" here in UA-cam and you will find it. Best of luck with your project!

  • @PinguinoRodriguez-hd8bw
    @PinguinoRodriguez-hd8bw 2 місяці тому +3

    I couldn't tell from the video, does this support app router routing?

    • @TheMomander
      @TheMomander 2 місяці тому

      It does! In fact, the example in the video is using the app router. Check out the GitHub repository to see how it's done.

  • @Mendez_84
    @Mendez_84 3 місяці тому +2

    It'd be great if we could add min/max instances schedules. Like, keep one min instance during office hours and zero min instances the rest of the time. Maybe even throw some ai at it to detect traffic patterns and suggest/apply those schedules

  • @Ivo-bq2nv
    @Ivo-bq2nv 2 місяці тому +1

    Thank you 😊

  • @svaponi
    @svaponi 2 місяці тому +1

    I would love to hear something about a GCloud alternative to the Edge Network the Vercel (author of the framework) provides.

    • @MartinOmander
      @MartinOmander 2 місяці тому

      You may find our video "Speed up your Cloud Run service by hosting it closer to your users" useful. We published it a few years ago, so the load balancer setup is easier now than shown in the video. Just click "Integrations" in your Cloud Run service and add the integration for "Custom domains -- Google Cloud Load". That automates the tedious parts of setting up a load balancer.

  • @RicardonesM
    @RicardonesM 3 місяці тому +1

    Exactly what I was looking for! Thank you!
    Would you know what terraform modules one should use to make the CI/CD integration work via IaaC?

    • @TheMomander
      @TheMomander 3 місяці тому

      Happy to hear the video was useful! The Terraform module "GoogleCloudPlatform/cloud-run" helps with Cloud Run setup.

  • @khaledmaarouf4757
    @khaledmaarouf4757 10 днів тому +1

    What's about static files? Is Cloud Run handling static files like app hosting through CDN? 🤔

    • @TheMomander
      @TheMomander 5 днів тому

      You have a few options for static files. You can either let Cloud Run handle them for you, and optionally add a load balancer and Cloud CDN in front of it. Another option is to put your static files in a public bucket on Cloud Storage. Or you can put your static files on Firebase Hosting, which includes a CDN. I usually use Firebase Hosting, because there is less configuration needed.

  • @Maverick_7821
    @Maverick_7821 3 місяці тому

    Thank You For Showing This Google

  • @ShootingUtah
    @ShootingUtah 3 місяці тому +1

    So I'm a bit of a noob with deploying websites, my nextjs app builds just fine on my machine but fails on cloud run. I assumed I had messed up something with environment variables but I've tried everything I can think of and still no luck! Any tips on digging through the logs or some other way to see exactly what's failing?

    • @TheMomander
      @TheMomander 3 місяці тому

      The log may contain error messages. In the Cloud Console, click the hamburger menu in the upper left corner, then click Logging. Best of luck with your project!

  • @monkeydluffy2063
    @monkeydluffy2063 3 місяці тому +1

    What kind of server-side apps can cloud-run handle?
    If I were to containerize a Backend API and upload to cloud-run - any scenario in which this would be a bad idea?

    • @TheMomander
      @TheMomander 3 місяці тому

      Good question! Cloud Run provides availability and scalability by taking down and spinning up instances as needed. For that reason, software packages that assume they have full control over a persistent server tend not to run well on Cloud Run. Examples include stateful and heavy applications like databases. The solution is to run your database on a separate tier that's optimized for it, like CloudSQL or Firestore.

  • @ActiveAndReactive
    @ActiveAndReactive 3 місяці тому

    Missing the links that you promised to put in the description!

    • @TheMomander
      @TheMomander 3 місяці тому

      The links have been added to the description. Thank you for letting me know they were missing!

  • @dheer211
    @dheer211 3 місяці тому +2

    How do you decide between Firebase hosting and Cloud Run? Pros and Cons of each

    • @TheMomander
      @TheMomander 3 місяці тому +1

      Good question! I think it boils down to two things:
      1. If you are used to either one, continue using that.
      2. If you prefer to deploy source code, use Firebase. If you prefer to deploy containers, go with Cloud Run. Containers give you more flexibility, but not everyone needs that. For example you can include binary executables or data files your containers.

    • @brandonwinston
      @brandonwinston 3 місяці тому +1

      @@TheMomander I had this same question. Thank you for answering. I think this needs to be addressed more prominently!

  • @jolycky
    @jolycky 2 місяці тому

    the cloud run can't access environment variables and the logs showed undefined

    • @GoogleLuke
      @GoogleLuke 2 місяці тому

      Happy to help! This should be doable in Cloud Run (I have it working on my own project and just tested this morning to confirm). Environment variables can be added to Cloud Run through the console.
      Cloud Run -> [Click Your service Name] -> EDIT & DEPLOY NEW REVISION -> VARIABLES & SECRETS
      Example:
      MY_SECRET_VARIABLE 93f8jaiofjaiwfjpi8awj3f9
      Then you can use process.env.MY_SECRET_VARIABLE to reference it in the code.
      If this is these are client-side variables, they will need the prefix NEXT_PUBLIC_ in front of them.
      It this doesn't solve your problem, can you share more information?

  • @julioconradomarinardila3269
    @julioconradomarinardila3269 3 місяці тому

    Next js es una excelente app

  • @LukasScheucher
    @LukasScheucher Місяць тому

    I dont really understand why they need to make these tutorial so cringy.

  • @putujojo1968
    @putujojo1968 23 дні тому

    NEXT_PUBLIC_ENV doesn't work on the client side. But, on the server side it works. Nice try google

    • @LukeSchlangen
      @LukeSchlangen 5 днів тому

      It should! Can you share a repository or an example where it’s not working?