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 Feature | Direct Cloud Run | Defang |
|---|---|---|
| Multi-service compose.yaml | Deploy each service separately | Deploys entire stack together |
| Service discovery by name | Not built in — use URLs | Automatic via private networking |
depends_on ordering | Not supported | Respected |
| Single deploy command | One gcloud run deploy per service | defang compose up |
| Local-production parity | Different configs for each environment | Same compose.yaml everywhere |
| Environment variables | Set per-service in Console or CLI | Defined 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:
- Set up gcloud CLI and authenticate
- Enable APIs: Cloud Run, Cloud Build, Artifact Registry, Cloud SQL, Secret Manager
- Create Artifact Registry repository for your images
- Configure Cloud Build to build your images
- Create VPC and configure VPC Connector for Cloud SQL access
- Set up Cloud SQL instance with proper networking
- Create secrets in Secret Manager for database credentials
- Deploy each Cloud Run service separately with environment variables, secrets, VPC connector
- 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
| Feature | Defang | Direct Cloud Run |
|---|---|---|
| Docker Compose support | Native — deploys your compose.yaml | None — individual containers only |
| Multi-service deploy | All services deploy together | Manual per service |
| Database provisioning | One annotation (x-defang-postgres) | Manual Cloud SQL setup |
| Secret management | Automatic | Manual Secret Manager |
| VPC configuration | Automatic | Manual setup required |
| IAM configuration | Automatic | Manual roles needed |
| Local dev parity | Same compose.yaml locally and in production | Different configs per environment |
| LLM provisioning | One annotation (x-defang-llm) | Manual Vertex AI setup |
| MongoDB | One annotation (x-defang-mongodb) | Manual Firestore setup |
| Environments | Named 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.