
Gcp Cloud Run
Covers both Cloud Run services for containerized apps and Cloud Run Functions for event-driven workloads. The patterns here are practical: multi-stage Docker builds, graceful shutdown handling, and Pub/Sub integration that actually shows you how to decode messages. The cold start optimization section is honest about the tradeoffs, like how minimum instances cost money but kill latency, or how higher memory allocation gives you more startup CPU. Watch out for the sharp edges around CPU throttling and the in-memory /tmp filesystem. If you're building serverless on GCP and need to move past the basics, this gives you the production-ready patterns without the usual tutorial fluff.
- skills.sh installs
- 235
- GitHub stars
- 33.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add davila7/claude-code-templates --skill gcp-cloud-run --agent claude-codeInstalls into .claude/skills of the current project.
Files
GCP Cloud Run
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"]
// 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' });
}
});
Sponsors
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Code Review & Quality, Cloud & Infrastructure
- First seen
- Jun 3, 2026
More from davila7/claude-code-templates
All 618- Gepetto234
- Qiskit234
- Pysam233
- Pufferlib232
- Web Quality Audit232
- Cc Skill Strategic Compact231
- Cc Skill Project Guidelines Example230
- Internal Comms230
- Professional Communication227
- Datacommons Client225
- Brenda Database222
- Heygen Best Practices222
- Hmdb Database222
- Umap Learn222
- Arboreto221
- Clerk Auth220
- Cellxgene Census219
- Kaizen219
- Lamindb219
- Nosql Expert219
- Opentargets Database219
- Pyopenms219
- Capa Officer218
- Deeptools218