# Deploy to Cloud Run

In 
GCP
Published 2022-12-03

Cloud Run is a managed compute platform that lets you run containers directly on top of Google's scalable infrastructure.

On Cloud Run, your code can either run continuously as a service or as a job. Both services and jobs run in the same environment and can use the same integrations with other services on Google Cloud.

Cloud Run services: Used to run code that responds to web requests, or events.

Cloud Run jobs: Used to run code that performs work (a job) and quits when the work is done.

Prerequisite:

  • you have already an image deployed to Container Registry.

In order to deploy a container on Cloud Run, we need to open the GCP Console, click on "Serverless" -> "Cloud Run".

We will see a screen like this:

Click on "Create Service".

Click on "Select" and select a container from Container Registry. I will choose the one for demo.

Choose a name for the service, the region, and how the CPUs are allocated.

Enter settings about the autoscaling, authentication and how the direct access is allowed to your service from the Internet.

You could add more information on the memory usage, network, and security.

Add on "Create" button and the container will be created and deployed on Cloud Run. When the service is created we will see an image as bellow:

We can take the URL from this page and test it in the browser.