Serverless container platform for stateless HTTP workloads
Core Idea: Google Cloud Run is a managed compute platform that automatically scales stateless containers, allowing developers to run containerized applications without managing infrastructure while only paying for actual usage.
Key Elements
-
Key Features
- Fully managed serverless container platform
- Automatic scaling from zero to many instances
- Pay-per-use pricing model (pay only for resources used during request processing)
- Container-based deployment model
- HTTP/HTTPS request handling
- Native support for Docker containers
- Concurrency control per container
- Custom domain mapping
-
Technical Specifications
- Supports containers built for x86-64 architecture
- Memory allocation: 128MB to 32GB
- CPU allocation: 1-8 vCPUs
- Request timeout: up to 60 minutes
- Container instance startup time: typically seconds
- Container instance maximum lifetime: 24 hours
- Container size limit: 10GB
- Maximum concurrent requests per instance: configurable
-
Use Cases
- Web applications and APIs
- Backend services
- Data processing APIs
- Webhooks and integrations
- Internal microservices
- Application modernization
- Workflow automation applications (e.g., n8n)
- Batch processing systems
-
Implementation Steps
- Containerize application with Dockerfile
- Configure container to listen on PORT environment variable
- Build and push container to Container Registry or Artifact Registry
- Deploy to Cloud Run via gcloud CLI or Console
- Configure service (memory, CPU, concurrency, timeout)
- Set up service accounts and permissions
- Configure environment variables and secrets
-
Code Example
# Deploy a container to Cloud Run
gcloud run deploy service-name \
--image gcr.io/project-id/image-name \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--memory 512Mi \
--cpu 1 \
--min-instances 0 \
--max-instances 10 \
--concurrency 80 \
--timeout 300s
Connections
- Related Concepts: Serverless Computing (architectural paradigm), Serverless Deployment (implementation approach), Google Cloud Functions (function-based alternative), Container Orchestration (related concept)
- Broader Context: Google Cloud Platform (parent platform), Containers as a Service (service model)
- Applications: n8n on Cloud Run (workflow automation example), Serverless Cost Optimization (deployment strategy)
- Components: Cloud Run Service Account, Container Registry, Cloud Build
References
- Google Cloud Run Documentation (https://cloud.google.com/run/docs)
- "Self-Hosting n8n on Google Cloud Run" guide
#google-cloud #serverless #containers #cloud-native #cloud-run
Connections:
Sources:
- From: Serverless Deployment