This simple setup enables you to serve videos using Cloud Run.
The image that is built is very simple, it consists of two endpoints:
/
serves the index.html that references the video./video
serves the video file in chunks smaller than 32MB to mitigate the max request/response limits on Cloud Run.
You can for instance use Sintel. Download it, (I chose the 2048-surround version)
and rename it to movie.mp4
in the root of the project.
gcloud build -t gcr.io/[PROJECT-ID]/movies/sintel .
gcloud push gcr.io/[PROJECT-ID]/movies/sintel
gcloud beta run deploy sintel-movie --allow-unauthenticated --image=gcr.io/[PROJECT-ID]/movies/sintel --region=us-central1
When this deployment is successful, you will be presented with an URL; browse to it and enjoy the video!
Register a Google Cloud Build trigger using the provided cloudbuild.yaml
as starting point.