Fireship · @fireship
Cloud Run QuickStart - Docker to Serverless
Uploaded April 10, 2019 · Length 7:50
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.
- 0:00
[Music]
- 0:06
yesterday GCP announced a very exciting
- 0:08
new product called cloud run it's a
- 0:10
service that allows you to convert any
- 0:12
back-end code written in any programming
- 0:13
language with any dependencies into a
- 0:15
service function this means you can
- 0:17
deploy fully managed micro services that
- 0:19
will scale automatically while only
- 0:20
paying for the actual resources that you
- 0:22
use in today's video I'll show you how
- 0:24
to take a server-side rendered
- 0:25
JavaScript application containerize it
- 0:27
with docker deploy to cloud run and then
- 0:29
hook it up to firebase hosting if you're
- 0:31
new here like and subscribe and you can
- 0:33
grab the full walkthrough from buyer
- 0:34
ship IO I'm really excited about cloud
- 0:36
run because it's the service I've been
- 0:38
wishing for ever since I started working
- 0:39
with service functions the single
- 0:41
biggest problem with server list has
- 0:42
always been the limitation of the
- 0:44
runtime most cloud providers only offer
- 0:46
a few different programming languages
- 0:47
and if you need any special dependencies
- 0:49
in your runtime then you're basically
- 0:50
out of luck your only real option at
- 0:52
that point is to provision a virtual
- 0:54
machine or use something like App Engine
- 0:55
to deploy your code and those resources
- 0:57
are always online which means you're
- 0:59
always paying for them and you also have
- 1:00
to worry about scaling them up and down
- 1:02
cloud run is basically the best of both
- 1:04
worlds and really the future of cloud
- 1:06
computing in general in my opinion all
- 1:07
you have to do as a developer is write
- 1:09
your code and then wrap it in a docker
- 1:11
image the one thing to keep in mind
- 1:12
though is that your code needs to be
- 1:14
stateless in other words you can't be
- 1:16
saving permanent files to the file
- 1:17
system or be running a sequel database
- 1:19
and expect to have access to that data
- 1:21
later that shouldn't be a problem
- 1:22
because you should be building stateless
- 1:23
applications anyway while using things
- 1:25
like cloud storage fires store or cloud
- 1:27
sequel to manage your persistent data
- 1:29
now let's take a look at a few things
- 1:31
that you might want to start using cloud
- 1:32
run for the first thing is server-side
- 1:35
rendering JavaScript applications I'm
- 1:36
going to show you how to do this with
- 1:38
Knux j/s and view but the same
- 1:39
principles apply to angular Universal or
- 1:41
next j/s with react
- 1:43
you could also hypothetically use it to
- 1:44
build a more traditional web application
- 1:46
like say WordPress or Ruby on Rails as
- 1:48
long as you keep the database outside of
- 1:50
the container and I find this one really
- 1:52
interesting because that means you could
- 1:53
have a wordpress site hosted on firebase
- 1:55
hosting and another use case for cloud
- 1:57
run would just be to create restful api
- 1:58
soar even graph QL api's and feel free


