Deploy to GCP Cloud Run

Serverless container deployment on Google Cloud Platform.

Prerequisites

Step-by-step

1

Install gcloud CLI

# macOS
brew install google-cloud-sdk

# Linux
curl https://sdk.cloud.google.com | bash

# Or download from:
# https://cloud.google.com/sdk/docs/install
2

Authenticate and set project

gcloud auth login
gcloud config set project YOUR_PROJECT_ID

Enable the required APIs:

gcloud services enable run.googleapis.com
gcloud services enable cloudbuild.googleapis.com
gcloud services enable artifactregistry.googleapis.com
3

Create your project with GCP target

npx agentvoy create my-project --build-mode app --deploy-target gcp-cloud-run --yes
4

Configure your .env

cd my-project-app
cp .env.example .env
# Add your API key to .env
5

Deploy

agentvoy deploy --target gcp-cloud-run

AgentVoy builds the container with Cloud Build, pushes to Artifact Registry, and deploys to Cloud Run.

6

Access your app

# Get the service URL
gcloud run services describe my-project --format="value(status.url)"

# View logs
gcloud run services logs read my-project

Generated files

+ Dockerfile
+ .dockerignore
+ deploy/cloud-run.yaml

Guard-to-Cloud Run mapping

timeout: 5m → Cloud Run request timeout
cost_limit: $1.00 → Memory: 512Mi, CPU: 1
allow_shell: false → Non-root container user