The mission of Cloud Run in life is to deploy and scale HTTP/S-driven workloads packed in containers. So let’s build a container for our Ruby on Rails application. As the goal of this tutorial is to show you how to best leverage various GCP services, let’s rely on Google Cloud Build (GCB) to assemble our container.
Prior to launching the build command we must grant Cloud Build (or more precisely the service account that impersonates Cloud Build) with the
cloudkms.cryptoKeyDecrypter role on the three pieces of information that we encrypted earlier (see Part 3). With this role Cloud Build is able to decrypt those secrets when needed in the build process (more on this in the
If not already done in Part 1, enable the Cloud Run API:
$ gcloud services enable run.googleapis.com
Also define the Google Cloud region Cloud Run will be running in:
$ gcloud config set run/region us-central1
Note: as of this writing Cloud Run is still in beta phase and, therefore, only available from the
Since version 5.2, Rails generates a secret master key to encrypt user session parameters in cookies, other types of sensitive information going back and forth between the application and the browser as well as your own application data of need be. …
Part 1 was about setting up your GCP project as well as your work environment. Let’s now focus on the Photo Album application itself and run it locally before going to production.
Note: running the Photo Album application in your local environment is optional. You can safely skip this part (or just skim through it) and go to Part 3.
The Rails application we are using in this tutorial is a Photo Album. …