
Gcp Cloud Run
Design and ship production-minded Cloud Run services and event-driven Functions on GCP with Dockerfile patterns, concurrency, and cold-start guidance.
Overview
GCP Cloud Run is an agent skill most often used in Build (also Operate) that guides production-ready serverless services, Functions, and Pub/Sub-driven architectures on Google Cloud.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill gcp-cloud-runWhat is this skill?
- Covers Cloud Run services for containerized web/API workloads and Cloud Run Functions for simple event handlers
- Documents cold-start mitigation: startup CPU boost, min instances, and fast stateless container startup
- Recommends tuning concurrency starting at 8 and planning memory including /tmp usage
- Includes multi-stage Dockerfile pattern (Node 20 slim) for smaller production images
- Guidance on VPC Connector tradeoffs—use only when private network access is required
- Recommends starting Cloud Run concurrency tuning at 8
Adoption & trust: 1.1k installs on skills.sh; 40.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to ship on GCP serverless but are unsure which Cloud Run primitive to use, how to size concurrency and memory, or how to keep cold starts from ruining UX.
Who is it for?
Indie developers shipping a containerized API or webhook worker on GCP who need opinionated serverless architecture in one place.
Skip if: Builders committed to long-lived VMs, Kubernetes-first deployments, or clouds other than GCP without adaptation.
When should I use this skill?
You are building or hardening a GCP serverless app and need Cloud Run versus Functions guidance, container patterns, and cold-start defaults.
What do I get? / Deliverables
You leave with concrete service versus Function choices, container build patterns, and tuning defaults you can apply before deploying traffic.
- Cloud Run service Dockerfile pattern
- Architecture choice notes (service vs function)
- Tuning checklist for concurrency, memory, and cold starts
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Build/backend is the primary shelf because the skill centers on implementing containerized APIs and serverless handlers, not day-two incident triage alone. Backend captures stateless HTTP services, Pub/Sub triggers, and container packaging rather than frontend or pure CI wiring.
Where it fits
Scaffold a multi-stage Node Dockerfile and Cloud Run service defaults before merging your API branch.
Set min instances and concurrency before flipping production traffic to a new revision.
Decide whether Pub/Sub plus Functions is enough or you need a full Cloud Run service with custom runtime dependencies.
How it compares
Opinionated GCP serverless skill patterns—not a turnkey Terraform or CI/CD marketplace workflow by itself.
Common Questions / FAQ
Who is gcp-cloud-run for?
Solo builders and small teams implementing APIs, background jobs, or event handlers on Google Cloud Run who want agent-guided architecture and Dockerfile conventions.
When should I use gcp-cloud-run?
Use it in Build/backend while designing containers and handlers, and in Operate/infra when tuning cold starts, concurrency, and Pub/Sub-driven scaling after initial deploy.
Is gcp-cloud-run safe to install?
Check the Security Audits panel on this Prism page for upstream risk labels and audit results; validate any deploy commands against your org’s GCP IAM policies.
SKILL.md
READMESKILL.md - Gcp Cloud Run
# GCP Cloud Run Specialized skill for building production-ready serverless applications on GCP. Covers Cloud Run services (containerized), Cloud Run Functions (event-driven), cold start optimization, and event-driven architecture with Pub/Sub. ## Principles - Cloud Run for containers, Functions for simple event handlers - Optimize for cold starts with startup CPU boost and min instances - Set concurrency based on workload (start with 8, adjust) - Memory includes /tmp filesystem - plan accordingly - Use VPC Connector only when needed (adds latency) - Containers should start fast and be stateless - Handle signals gracefully for clean shutdown ## Patterns ### Cloud Run Service Pattern Containerized web service on Cloud Run **When to use**: Web applications and APIs,Need any runtime or library,Complex services with multiple endpoints,Stateless containerized workloads ```dockerfile # Dockerfile - Multi-stage build for smaller image FROM node:20-slim AS builder WORKDIR /app COPY package*.json ./ RUN npm ci --only=production FROM node:20-slim WORKDIR /app # Copy only production dependencies COPY --from=builder /app/node_modules ./node_modules COPY src ./src COPY package.json ./ # Cloud Run uses PORT env variable ENV PORT=8080 EXPOSE 8080 # Run as non-root user USER node CMD ["node", "src/index.js"] ``` ```javascript // src/index.js const express = require('express'); const app = express(); app.use(express.json()); // Health check endpoint app.get('/health', (req, res) => { res.status(200).send('OK'); }); // API routes app.get('/api/items/:id', async (req, res) => { try { const item = await getItem(req.params.id); res.json(item); } catch (error) { console.error('Error:', error); res.status(500).json({ error: 'Internal server error' }); } }); // Graceful shutdown process.on('SIGTERM', () => { console.log('SIGTERM received, shutting down gracefully'); server.close(() => { console.log('Server closed'); process.exit(0); }); }); const PORT = process.env.PORT || 8080; const server = app.listen(PORT, () => { console.log(`Server listening on port ${PORT}`); }); ``` ```yaml # cloudbuild.yaml steps: # Build the container image - name: 'gcr.io/cloud-builders/docker' args: ['build', '-t', 'gcr.io/$PROJECT_ID/my-service:$COMMIT_SHA', '.'] # Push the container image - name: 'gcr.io/cloud-builders/docker' args: ['push', 'gcr.io/$PROJECT_ID/my-service:$COMMIT_SHA'] # Deploy to Cloud Run - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' entrypoint: gcloud args: - 'run' - 'deploy' - 'my-service' - '--image=gcr.io/$PROJECT_ID/my-service:$COMMIT_SHA' - '--region=us-central1' - '--platform=managed' - '--allow-unauthenticated' - '--memory=512Mi' - '--cpu=1' - '--min-instances=1' - '--max-instances=100' - '--concurrency=80' - '--cpu-boost' images: - 'gcr.io/$PROJECT_ID/my-service:$COMMIT_SHA' ``` ### Structure project/ ├── Dockerfile ├── .dockerignore ├── src/ │ ├── index.js │ └── routes/ ├── package.json └── cloudbuild.yaml ### Gcloud_deploy # Direct gcloud deployment gcloud run deploy my-service \ --source . \ --region us-central1 \ --allow-unauthenticated \ --memory 512Mi \ --cpu 1 \ --min-instances 1 \ --max-instances 100 \ --concurrency 80 \ --cpu-boost ### Cloud Run Functions Pattern Event-driven functions (formerly Cloud Functions) **When to use**: Simple event handlers,Pub/Sub message processing,Cloud Storage triggers,HTTP webhooks ```javascript // HTTP Function // index.js const functions = require(