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-code

Installs 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
1mjunaidca avatarpolymarket-strategy-advisormjunaidca/polymarket-skillsUse this skill whenever the user wants trading strategy advice, trade recommendations, portfolio guidance, or prediction market analysis that leads to actionabl235skills.sh installs
2davila7 avatargepettodavila7/claude-code-templatesCreates detailed, sectionized implementation plans through research, stakeholder interviews, and multi-LLM review. Use when planning features that need thorough234skills.sh installs
3tech-leads-club avatarfigma-implement-designtech-leads-club/agent-skillsTranslate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convent234skills.sh installs
4glebis avatargranolaglebis/claude-skillsThis skill should be used when importing, listing, or exporting Granola meeting recordings and transcripts. Queries Granola's Personal API to list meetings, ext233skills.sh installs
5pproenca avatargraph-schemapproenca/dot-skillsGraph database schema design and data modeling expert. Use when designing, reviewing, or refactoring graph database schemas (Neo4j, Memgraph, Neptune, etc.). Tr233skills.sh installs
6rmyndharis avatarjava-prormyndharis/antigravity-skillsMaster Java 21+ with modern features like virtual threads, pattern matching, and Spring Boot 3.x. Expert in the latest Java ecosystem including GraalVM, Project233skills.sh installs