After creating an app with an AI-assisted tool like
[Google AI Studio](https://aistudio.google.com/docs/aistudio-deploying)
or [Agent Studio](https://docs.cloud.google.com/gemini-enterprise-agent-platform/agent-studio/deploy-vais-prompt.md.txt),
you can use [Cloud Run](https://docs.cloud.google.com/run/docs/overview/what-is-cloud-run.md.txt)
to deploy the app and make it available to users.

This guide describes the concepts of Cloud Run and some
modifications you can make after you use an AI-assisted tool or

[vibe coding](https://cloud.google.com/discover/what-is-vibe-coding)

tool to create and deploy an app. Understanding these concepts helps you
transition your application from a development environment to a scalable
platform.

## From code to container

Cloud Run runs your application inside a container. A container
is a standard package that includes your application code and all its
dependencies. This packaging ensures that your application runs reliably and
consistently in any computing environment.

If you're not familiar with containers, Cloud Run lets you
[deploy from source code](https://docs.cloud.google.com/run/docs/deploying-source-code.md.txt), otherwise, you can
[deploy container images](https://docs.cloud.google.com/run/docs/deploying.md.txt).

To deploy to Cloud Run, you first build your application into a
container image. You can create a container image using a `Dockerfile` or have
Google Cloud build one for you automatically from your source code
using buildpacks. You then store this image in an artifact registry.

## How Cloud Run works

Cloud Run uses a few core resources to manage and run your
containerized application. These resources work together to provide a seamless
deployment and scaling experience.

A *service* is the primary resource in Cloud Run. Each service
has a unique, permanent URL (`run.app`). When you deploy to a service,
Cloud Run creates a new, immutable revision. A *revision*
consists of a specific container image and settings that you configure, such as
memory limits and environment variables.

By default, Cloud Run automatically runs your revisions on one or
more instances. An *instance* , sometimes called a *container instance* , is a
single, isolated environment that runs a copy of your container within a
Cloud Run service. To manage costs, Cloud Run
scales the number of instances up or down to as low as to zero, based on the
number of incoming instances. Cloud Run also lets you
[configure different settings](https://docs.cloud.google.com/run/docs/configuring.md.txt) to control the behavior of
your service, and
[connect to Google Cloud services](https://docs.cloud.google.com/run/docs/integrate/using-gcp-services.md.txt)
to build a complete full-stack app that is highly scalable
.

When your Cloud Run service interacts with Google Cloud
APIs or other Cloud Run services, Cloud Run uses the
[service identity](https://docs.cloud.google.com/run/docs/securing/service-identity.md.txt) to access
Google Cloud APIs. By default, Cloud Run automatically uses
the [default Compute Engine service account](https://docs.cloud.google.com/run/docs/securing/service-identity.md.txt#types-of-service-accounts)
to make make calls to Google Cloud APIs to perform the operations it
needs. We recommend that you create a custom service account, and grant this
identity the minimal set of permissions needed for accessing a specific
Google Cloud resource.

## Update your service

After you've deployed your Cloud Run app using an AI-assisted
tool or vibe coding tool, you can update the default settings to optimize for
performance, cost, and security.
Note: If you deployed your app to a no-cost [Starter Tier](https://docs.cloud.google.com/docs/starter-tier.md.txt) project from Google AI Studio, you must [upgrade your Starter Tier project](https://docs.cloud.google.com/docs/starter-tier.md.txt#upgrade) to a user-managed Google Cloud project before you can modify service settings in the Google Cloud console.

To modify your service:

1. In the Google Cloud console, go to the Cloud Run **Services** page:

   [Go to Cloud Run](https://console.cloud.google.com/run/services)
2. Click the service you want to update in the services list.

3. In the **Containers** tab, you can configure the following:

   1. [Memory limits](https://docs.cloud.google.com/run/docs/configuring/services/memory-limits.md.txt) and [CPU limits](https://docs.cloud.google.com/run/docs/configuring/services/cpu.md.txt)
   2. [Ephemeral disks](https://docs.cloud.google.com/run/docs/configuring/services/ephemeral-disk.md.txt)
   3. [GPUs](https://docs.cloud.google.com/run/docs/configuring/services/gpu.md.txt)
   4. [Health checks](https://docs.cloud.google.com/run/docs/configuring/healthchecks.md.txt)
   5. [Environment variables](https://docs.cloud.google.com/run/docs/configuring/services/environment-variables.md.txt) and [secrets](https://docs.cloud.google.com/run/docs/configuring/services/secrets.md.txt)
   6. [Volumes](https://docs.cloud.google.com/run/docs/configuring/services/cloud-storage-volume-mounts.md.txt)
   7. [Cloud SQL connections](https://docs.cloud.google.com/sql/docs/mysql/connect-run.md.txt)
   8. [Execution environment](https://docs.cloud.google.com/run/docs/configuring/execution-environments.md.txt)
4. In the **Networking** tab, you can configure the following:

   1. [Ingress and disabling the default URL](https://docs.cloud.google.com/run/docs/securing/ingress.md.txt)
   2. [Cloud Service Mesh](https://docs.cloud.google.com/run/docs/configuring/cloud-service-mesh.md.txt)
   3. [VPC connection](https://docs.cloud.google.com/run/docs/configuring/connecting-vpc.md.txt)
   4. [HTTP/2](https://docs.cloud.google.com/run/docs/configuring/http2.md.txt) and [session affinity](https://docs.cloud.google.com/run/docs/configuring/session-affinity.md.txt)
5. In the **Security** tab, you can configure the following:

   1. [Authentication](https://docs.cloud.google.com/run/docs/authenticating/overview.md.txt) preferences
   2. [Service accounts](https://docs.cloud.google.com/run/docs/configuring/services/service-identity.md.txt)
   3. [Binary Authorization](https://docs.cloud.google.com/run/docs/securing/binary-authorization.md.txt)
   4. [Customer KMS keys](https://docs.cloud.google.com/run/docs/securing/using-cmek.md.txt)
   5. [Cloud Run Threat Detection](https://docs.cloud.google.com/run/docs/securing/cloud-run-threat-detection.md.txt)
6. In the **Scaling** tab, you can configure the following:

   1. [Autoscaling](https://docs.cloud.google.com/run/docs/about-instance-autoscaling.md.txt) or [manual scaling](https://docs.cloud.google.com/run/docs/configuring/services/manual-scaling.md.txt)
   2. [Billing](https://docs.cloud.google.com/run/docs/configuring/billing-settings.md.txt) preferences
   3. [Request timeout](https://docs.cloud.google.com/run/docs/configuring/request-timeout.md.txt) and [concurrency](https://docs.cloud.google.com/run/docs/configuring/concurrency.md.txt)
7. Click **View diff \& redeploy** , then **Deploy changes** to deploy your
   changes.

To learn more about viewing, copying, or deleting your service, see
[Manage services](https://docs.cloud.google.com/run/docs/managing/services.md.txt).

## Best practices

For best practices to ensure your apps run efficiently on
Cloud Run, see [Develop your service](https://docs.cloud.google.com/run/docs/developing.md.txt) and
[General development tips for services](https://docs.cloud.google.com/run/docs/tips/general.md.txt).

Cloud Run and the Google Cloud services that your app uses
is a billable service. You can use the
[pricing calculator](https://cloud.google.com/products/calculator) to estimate
your costs based on your expected usage.

## What's next

- To get started, follow the quickstart to [deploy a container image](https://docs.cloud.google.com/run/docs/quickstarts/deploy-container.md.txt).
- To learn about the different types of resources and deployment options, see [Resource model](https://docs.cloud.google.com/run/docs/resource-model.md.txt).
- For information on preparing your code for deployment, see the [Container runtime contract](https://docs.cloud.google.com/run/docs/container-contract.md.txt).
- To learn more about the benefits of using Cloud Run, See [Cloud Run AI use cases](https://docs.cloud.google.com/run/docs/ai/use-cases.md.txt).
- To learn about deploying full-stack web apps to a no-cost Starter Tier project, see [Starter Tier overview](https://docs.cloud.google.com/docs/starter-tier.md.txt).