Defang Cloud Run

Defang vs Direct Cloud Run Deployment

You have a multi-service Docker Compose app. Cloud Run deploys individual containers. Defang bridges the gap.

Last reviewed: February 19, 2026

Defang vs Direct Cloud Run Deployment

You have a multi-service Docker Compose application that works locally. You run docker compose up and your web server, API, database, and cache all come up together, discovering each other by name.

Cloud Run deploys individual containers, not Docker Compose applications. Each service becomes a separate Cloud Run service with its own configuration, networking, and deployment. Defang bridges this gap — it reads your compose.yaml and handles all the Cloud Run plumbing automatically.

The Docker Compose Gap

When you deploy a multi-service Docker Compose app to Cloud Run directly, you lose the things that make Docker Compose work:

Docker Compose FeatureDirect Cloud RunDefang
Multi-service compose.yamlDeploy each service separatelyDeploys entire stack together
Service discovery by nameNot built in — use URLsAutomatic via private networking
depends_on orderingNot supportedRespected
Single deploy commandOne gcloud run deploy per servicedefang compose up
Local-production parityDifferent configs for each environmentSame compose.yaml everywhere
Environment variablesSet per-service in Console or CLIDefined once in compose.yaml

Deployment Complexity

Direct Cloud Run

To deploy a typical Docker Compose web application with a database to Cloud Run, you need to:

  1. Set up gcloud CLI and authenticate
  2. Enable APIs: Cloud Run, Cloud Build, Artifact Registry, Cloud SQL, Secret Manager
  3. Create Artifact Registry repository for your images
  4. Configure Cloud Build to build your images
  5. Create VPC and configure VPC Connector for Cloud SQL access
  6. Set up Cloud SQL instance with proper networking
  7. Create secrets in Secret Manager for database credentials
  8. Deploy each Cloud Run service separately with environment variables, secrets, VPC connector
  9. Configure IAM roles for service accounts

That’s 9+ manual steps per service, each with its own configuration options and potential for error.

With Defang

# Your entire Docker Compose stack
defang compose up --provider=gcp

Defang reads your compose.yaml and handles all the above automatically — for every service in your stack.

Feature Comparison

FeatureDefangDirect Cloud Run
Docker Compose supportNative — deploys your compose.yamlNone — individual containers only
Multi-service deployAll services deploy togetherManual per service
Database provisioningOne annotation (x-defang-postgres)Manual Cloud SQL setup
Secret managementAutomaticManual Secret Manager
VPC configurationAutomaticManual setup required
IAM configurationAutomaticManual roles needed
Local dev paritySame compose.yaml locally and in productionDifferent configs per environment
LLM provisioningOne annotation (x-defang-llm)Manual Vertex AI setup
MongoDBOne annotation (x-defang-mongodb)Manual Firestore setup
EnvironmentsNamed stacks (dev/staging/prod)Manual per-project

When to Use Each

Choose Defang when:

  • You have a Docker Compose application and want to deploy it as-is
  • You’re deploying multi-service applications
  • You want managed database provisioning from your compose.yaml
  • You value developer experience and local-production parity
  • You want to minimize GCP-specific knowledge needed
  • You want managed LLMs (Vertex AI) with a simple annotation
  • You need multiple deployment environments (dev/staging/prod)

Choose Direct Cloud Run when:

  • You need very specific Cloud Run configurations not available through Compose
  • You’re integrating with complex existing GCP infrastructure
  • You have dedicated DevOps resources and GCP expertise
  • You’re deploying a single container, not a multi-service app
  • You need features not yet supported by Defang

Try It

Take the compose.yaml you use with docker compose up locally and deploy it to GCP:

# Install Defang
brew install defang-io/defang/defang

# Deploy your existing compose.yaml to GCP
defang compose up --provider=gcp

Same Docker Compose file. Production Cloud Run infrastructure. No manual GCP configuration.

Our Verdict

Defang dramatically simplifies Cloud Run deployments while keeping your Docker Compose workflow intact.