After creating an app with an AI-assisted toollike Google AI Studio and Vertex AI Studio, you can use Cloud Run 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, otherwise, you can deploy container images.
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 to control the behavior of your service, and connect to Google Cloud services 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 to access Google Cloud APIs. By default, Cloud Run automatically uses the default Compute Engine service account 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.
To modify your service:
Go to the Cloud Run page in the Google Cloud console:
Select your service.
Select Edit and deploy new revision.
Modify the configuration settings as needed.
In the Edit Container section, you can modify the following:
In the Security tab, select the available options, such as:
In the Security tab, modify the default compute service account to a different service accounts with minimal permissions.
Under Request, modify the following if needed:
Under Billing, modify the billing settings if needed.
- Under Execution environment, modify the execution environment if needed.
Under Revision scaling, if you use the default Cloud Run autoscaling, optionally specify the minimum instances. If you use manual scaling, specify the number of instances for the service.
Click Edit & deploy new revision.
To learn more about viewing, copying, or deleting your service, see Manage services.
Best practices
For best practices to ensure your apps run efficiently on Cloud Run, see Develop your service and General development tips for services.
Cloud Run and the Google Cloud services that your app uses is a billable service. You can use the pricing calculator to estimate your costs based on your expected usage.
What's next
- To get started, follow the quickstart to deploy a container image.
- To learn about the different types of resources and deployment options, see Resource model.
- For information on preparing your code for deployment, see the Container runtime contract.
- To learn more about the benefits of using Cloud Run, See Cloud Run AI use cases.