Fireship · @fireship

Cloud Run QuickStart - Docker to Serverless

Uploaded April 10, 2019 · Length 7:50

Cloud Run QuickStart - Docker to Serverless

Summary

This video teaches how to deploy a server-side rendered JavaScript application to Cloud Run using Docker and Firebase Hosting.

  • cloud run quickstart
  • docker to serverless
  • server-side rendering
  • javascript on cloud run
  • firebase hosting

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    [Music]

  2. 0:06

    yesterday GCP announced a very exciting

  3. 0:08

    new product called cloud run it's a

  4. 0:10

    service that allows you to convert any

  5. 0:12

    back-end code written in any programming

  6. 0:13

    language with any dependencies into a

  7. 0:15

    service function this means you can

  8. 0:17

    deploy fully managed micro services that

  9. 0:19

    will scale automatically while only

  10. 0:20

    paying for the actual resources that you

  11. 0:22

    use in today's video I'll show you how

  12. 0:24

    to take a server-side rendered

  13. 0:25

    JavaScript application containerize it

  14. 0:27

    with docker deploy to cloud run and then

  15. 0:29

    hook it up to firebase hosting if you're

  16. 0:31

    new here like and subscribe and you can

  17. 0:33

    grab the full walkthrough from buyer

  18. 0:34

    ship IO I'm really excited about cloud

  19. 0:36

    run because it's the service I've been

  20. 0:38

    wishing for ever since I started working

  21. 0:39

    with service functions the single

  22. 0:41

    biggest problem with server list has

  23. 0:42

    always been the limitation of the

  24. 0:44

    runtime most cloud providers only offer

  25. 0:46

    a few different programming languages

  26. 0:47

    and if you need any special dependencies

  27. 0:49

    in your runtime then you're basically

  28. 0:50

    out of luck your only real option at

  29. 0:52

    that point is to provision a virtual

  30. 0:54

    machine or use something like App Engine

  31. 0:55

    to deploy your code and those resources

  32. 0:57

    are always online which means you're

  33. 0:59

    always paying for them and you also have

  34. 1:00

    to worry about scaling them up and down

  35. 1:02

    cloud run is basically the best of both

  36. 1:04

    worlds and really the future of cloud

  37. 1:06

    computing in general in my opinion all

  38. 1:07

    you have to do as a developer is write

  39. 1:09

    your code and then wrap it in a docker

  40. 1:11

    image the one thing to keep in mind

  41. 1:12

    though is that your code needs to be

  42. 1:14

    stateless in other words you can't be

  43. 1:16

    saving permanent files to the file

  44. 1:17

    system or be running a sequel database

  45. 1:19

    and expect to have access to that data

  46. 1:21

    later that shouldn't be a problem

  47. 1:22

    because you should be building stateless

  48. 1:23

    applications anyway while using things

  49. 1:25

    like cloud storage fires store or cloud

  50. 1:27

    sequel to manage your persistent data

  51. 1:29

    now let's take a look at a few things

  52. 1:31

    that you might want to start using cloud

  53. 1:32

    run for the first thing is server-side

  54. 1:35

    rendering JavaScript applications I'm

  55. 1:36

    going to show you how to do this with

  56. 1:38

    Knux j/s and view but the same

  57. 1:39

    principles apply to angular Universal or

  58. 1:41

    next j/s with react

  59. 1:43

    you could also hypothetically use it to

  60. 1:44

    build a more traditional web application

  61. 1:46

    like say WordPress or Ruby on Rails as

  62. 1:48

    long as you keep the database outside of

  63. 1:50

    the container and I find this one really

  64. 1:52

    interesting because that means you could

  65. 1:53

    have a wordpress site hosted on firebase

  66. 1:55

    hosting and another use case for cloud

  67. 1:57

    run would just be to create restful api

  68. 1:58

    soar even graph QL api's and feel free