This is a repo for my talk on hosting and deploying your apps like a pro using Cloud Run and Cloud Build
-
Create a new Project in Google Cloud Console https://cloud.google.com/resource-manager/docs/creating-managing-projects
-
Enable Billing on the Project https://cloud.google.com/billing/docs/how-to/modify-project
-
In the Google Cloud Console, enable the Cloud Build, Cloud Run, Container Registry, and Resource Manager APIs: https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com,run.googleapis.com,containerregistry.googleapis.com,cloudresourcemanager.googleapis.com&redirect=https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-cloud-run
-
In the Google Cloud Console, enable the Cloud Run Admin and Service Account User roles to the Cloud Build service account in IAM permissions https://console.cloud.google.com/cloud-build/settings/service-account?project=PROJECT-ID&folder=&organizationId=
-
Install and Initialize the Cloud SDK Locally https://cloud.google.com/sdk/docs
-
Containerize your app by adding Dockerfile and .dockerignore files https://cloud.google.com/run/docs/quickstarts/build-and-deploy
-
Build an image of your container using gcloud gcloud builds submit --tag gcr.io/PROJECT-ID/APP-NAME
-
Deploy the image to Cloud Run gcloud run deploy --image gcr.io/PROJECT-ID/APP-NAME --platform managed
Notes: a. PROJECT-ID should be all lowercase b. Be sure to re-login and set your project in gcloud if you already had it installed b. You can view your container in the Container Registry at: https://console.cloud.google.com/gcr/images/PROJECT-ID?project=PROJECT-ID c. You can build your image locally using docker build and upload later using docker push
-
View your service in Cloud Run
-
Click Set Up Continuous Deployment
-
Click Manage connected repositories to auth into Github and link your repo
-
Choose your Branch
-
Choose your Dockerfile
-
Click Save
Notes: a. You can create your own build configuration file or allow Cloud Build to do it for you.
b. You can view your Cloud Build Dashboard at: https://console.cloud.google.com/cloud-build/dashboard?project=PROJECT-ID