Cloud Run is very similar to Google’s App Engine and Cloud Functions. The main difference is that with Cloud Run, you can create custom Docker images.

This means you have way more control over how your application should be built and you can go crazy with complicated custom Docker builds. The downside is that it’s a bit harder to set up compared to Google’s App Engine.

In this article, I’ll show you how to set up a custom Docker image on Cloud Run.


Creating a Cloud Project

The first thing we need to do is create a new Google Cloud project. I’m going to set everything up using the command line.

First, I authenticate myself by running:

gcloud auth login

This will open a Google login browser window where I can select my account.

Then I create the new Google Cloud project:

gcloud projects create emojiapi-project

In this case, emojiapi-project is the project ID, so you can change that to something else.

Then, I set the current active project to emojiapi-project:

gcloud config set project emojiapi-project

Finally, I enable the Cloud Run API for this project:

gcloud services enable run.googleapis.com

#docker #google-cloud-platform #nodejs #javascript #programming #api

Deploy a Node API to Cloud Run
1.25 GEEK