DevOps Skill
Comprehensive guide for deploying and managing cloud infrastructure across Cloudflare edge platform, Docker containerization, and Google Cloud Platform.
When to Use This Skill
Use this skill when:
- Deploying serverless applications to Cloudflare Workers
- Containerizing applications with Docker
- Managing Google Cloud infrastructure with gcloud CLI
- Setting up CI/CD pipelines across platforms
- Optimizing cloud infrastructure costs
- Implementing multi-region deployments
- Building edge-first architectures
- Managing container orchestration with Kubernetes
- Configuring cloud storage solutions (R2, Cloud Storage)
- Automating infrastructure with scripts and IaC
Platform Selection Guide
When to Use Cloudflare
Best For:
- Edge-first applications with global distribution
- Ultra-low latency requirements (<50ms)
- Static sites with serverless functions
- Zero egress cost scenarios (R2 storage)
- WebSocket/real-time applications (Durable Objects)
- AI/ML at the edge (Workers AI)
Key Products:
- Workers (serverless functions)
- R2 (object storage, S3-compatible)
- D1 (SQLite database with global replication)
- KV (key-value store)
- Pages (static hosting + functions)
- Durable Objects (stateful compute)
- Browser Rendering (headless browser automation)
Cost Profile: Pay-per-request, generous free tier, zero egress fees
When to Use Docker
Best For:
- Local development consistency
- Microservices architectures
- Multi-language stack applications
- Traditional VPS/VM deployments
- Kubernetes orchestration
- CI/CD build environments
- Database containerization (dev/test)
Key Capabilities:
- Application isolation and portability
- Multi-stage builds for optimization
- Docker Compose for multi-container apps
- Volume management for data persistence
- Network configuration and service discovery
- Cross-platform compatibility (amd64, arm64)
Cost Profile: Infrastructure cost only (compute + storage)
When to Use Google Cloud
Best For:
- Enterprise-scale applications
- Data analytics and ML pipelines (BigQuery, Vertex AI)
- Hybrid/multi-cloud deployments
- Kubernetes at scale (GKE)
- Managed databases (Cloud SQL, Firestore, Spanner)
- Complex IAM and compliance requirements
Key Services:
- Compute Engine (VMs)
- GKE (managed Kubernetes)
- Cloud Run (containerized serverless)
- App Engine (PaaS)
- Cloud Storage (object storage)
- Cloud SQL (managed databases)
Cost Profile: Varied pricing, sustained use discounts, committed use contracts
Quick Start
Cloudflare Workers
# Install Wrangler CLI
npm install -g wrangler
# Create and deploy Worker
wrangler init my-worker
cd my-worker
wrangler deploy
See: references/cloudflare-workers-basics.md
Docker Container
# Create Dockerfile
cat > Dockerfile <<EOF
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
EOF
# Build and run
docker build -t myapp .
docker run -p 3000:3000 myapp
See: references/docker-basics.md
Google Cloud Deployment
# Install and authenticate
curl https://sdk.cloud.google.com | bash
gcloud init
gcloud auth login
# Deploy to Cloud Run
gcloud run deploy my-service \
--image gcr.io/project/image \
--region us-central1
See: references/gcloud-platform.md
Reference Navigation
Cloudflare Platform
cloudflare-platform.md - Edge computing overview, key components
cloudflare-workers-basics.md - Getting started, handler types, basic patterns
cloudflare-workers-advanced.md - Advanced patterns, performance, optimization
cloudflare-workers-apis.md - Runtime APIs, bindings, integrations
cloudflare-r2-storage.md - R2 object storage, S3 compatibility, best practices
cloudflare-d1-kv.md - D1 SQLite database, KV store, use cases
browser-rendering.md - Puppeteer/Playwright automation on Cloudflare
Docker Containerization
docker-basics.md - Core concepts, Dockerfile, images, containers
docker-compose.md - Multi-container apps, networking, volumes
Google Cloud Platform
gcloud-platform.md - GCP overview, gcloud CLI, authentication
gcloud-services.md - Compute Engine, GKE, Cloud Run, App Engine
Python Utilities
scripts/cloudflare-deploy.py - Automate Cloudflare Worker deployments
scripts/docker-optimize.py - Analyze and optimize Dockerfiles
Common Workflows
Edge + Container Hybrid
# Cloudflare Workers (API Gateway)
# -> Docker containers on Cloud Run (Backend Services)
# -> R2 (Object Storage)
# Benefits:
# - Edge caching and routing
# - Containerized business logic
# - Global distribution
Multi-Stage Docker Build
# Build stage
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
COPY --from=build /app/dist ./dist
COPY --from=build /app/node_modules ./node_modules
USER node
CMD ["node", "dist/server.js"]
CI/CD Pipeline Pattern
# 1. Build: Docker multi-stage build
# 2. Test: Run tests in container
# 3. Push: Push to registry (GCR, Docker Hub)
# 4. Deploy: Deploy to Cloudflare Workers / Cloud Run
# 5. Verify: Health checks and smoke tests
Best Practices
Security
- Run containers as non-root user
- Use service account impersonation (GCP)
- Store secrets in environment variables, not code
- Scan images for vulnerabilities (Docker Scout)
- Use API tokens with minimal permissions
Performance
- Multi-stage Docker builds to reduce image size
- Edge caching with Cloudflare KV
- Use R2 for zero egress cost storage
- Implement health checks for containers
- Set appropriate timeouts and resource limits
Cost Optimization
- Use Cloudflare R2 instead of S3 for large egress
- Implement caching strategies (edge + KV)
- Right-size container resources
- Use sustained use discounts (GCP)
- Monitor usage with cloud provider dashboards
Development
- Use Docker Compose for local development
- Wrangler dev for local Worker testing
- Named gcloud configurations for multi-environment
- Version control infrastructure code
- Implement automated testing in CI/CD
Decision Matrix
| Need |
Choose |
| Sub-50ms latency globally |
Cloudflare Workers |
| Large file storage (zero egress) |
Cloudflare R2 |
| SQL database (global reads) |
Cloudflare D1 |
| Containerized workloads |
Docker + Cloud Run/GKE |
| Enterprise Kubernetes |
GKE |
| Managed relational DB |
Cloud SQL |
| Static site + API |
Cloudflare Pages |
| WebSocket/real-time |
Cloudflare Durable Objects |
| ML/AI pipelines |
GCP Vertex AI |
| Browser automation |
Cloudflare Browser Rendering |
Resources
Implementation Checklist
Cloudflare Workers
Docker
Google Cloud
1---2name: devops3description: Deploy and manage cloud infrastructure on Cloudflare (Workers, R2, D1,4 KV, Pages, Durable Objects, Browser Rendering), Docker containers, and Google Cloud5 Platform (Compute Engine, GKE, Cloud Run, App Engine, Cloud Storage). Use when deploying6 serverless functions to the edge, configuring edge co...7license: MIT8version: 1.0.09risk: safe10source: community11metadata:12 source: https://skillmd.com/skills/jantoniofc/devops13---1415# DevOps Skill1617Comprehensive guide for deploying and managing cloud infrastructure across Cloudflare edge platform, Docker containerization, and Google Cloud Platform.1819## When to Use This Skill2021Use this skill when:22- Deploying serverless applications to Cloudflare Workers23- Containerizing applications with Docker24- Managing Google Cloud infrastructure with gcloud CLI25- Setting up CI/CD pipelines across platforms26- Optimizing cloud infrastructure costs27- Implementing multi-region deployments28- Building edge-first architectures29- Managing container orchestration with Kubernetes30- Configuring cloud storage solutions (R2, Cloud Storage)31- Automating infrastructure with scripts and IaC3233## Platform Selection Guide3435### When to Use Cloudflare3637**Best For:**38- Edge-first applications with global distribution39- Ultra-low latency requirements (<50ms)40- Static sites with serverless functions41- Zero egress cost scenarios (R2 storage)42- WebSocket/real-time applications (Durable Objects)43- AI/ML at the edge (Workers AI)4445**Key Products:**46- Workers (serverless functions)47- R2 (object storage, S3-compatible)48- D1 (SQLite database with global replication)49- KV (key-value store)50- Pages (static hosting + functions)51- Durable Objects (stateful compute)52- Browser Rendering (headless browser automation)5354**Cost Profile:** Pay-per-request, generous free tier, zero egress fees5556### When to Use Docker5758**Best For:**59- Local development consistency60- Microservices architectures61- Multi-language stack applications62- Traditional VPS/VM deployments63- Kubernetes orchestration64- CI/CD build environments65- Database containerization (dev/test)6667**Key Capabilities:**68- Application isolation and portability69- Multi-stage builds for optimization70- Docker Compose for multi-container apps71- Volume management for data persistence72- Network configuration and service discovery73- Cross-platform compatibility (amd64, arm64)7475**Cost Profile:** Infrastructure cost only (compute + storage)7677### When to Use Google Cloud7879**Best For:**80- Enterprise-scale applications81- Data analytics and ML pipelines (BigQuery, Vertex AI)82- Hybrid/multi-cloud deployments83- Kubernetes at scale (GKE)84- Managed databases (Cloud SQL, Firestore, Spanner)85- Complex IAM and compliance requirements8687**Key Services:**88- Compute Engine (VMs)89- GKE (managed Kubernetes)90- Cloud Run (containerized serverless)91- App Engine (PaaS)92- Cloud Storage (object storage)93- Cloud SQL (managed databases)9495**Cost Profile:** Varied pricing, sustained use discounts, committed use contracts9697## Quick Start9899### Cloudflare Workers100101```bash102# Install Wrangler CLI103npm install -g wrangler104105# Create and deploy Worker106wrangler init my-worker107cd my-worker108wrangler deploy109```110111See: `references/cloudflare-workers-basics.md`112113### Docker Container114115```bash116# Create Dockerfile117cat > Dockerfile <<EOF118FROM node:20-alpine119WORKDIR /app120COPY package*.json ./121RUN npm ci --production122COPY . .123EXPOSE 3000124CMD ["node", "server.js"]125EOF126127# Build and run128docker build -t myapp .129docker run -p 3000:3000 myapp130```131132See: `references/docker-basics.md`133134### Google Cloud Deployment135136```bash137# Install and authenticate138curl https://sdk.cloud.google.com | bash139gcloud init140gcloud auth login141142# Deploy to Cloud Run143gcloud run deploy my-service \144 --image gcr.io/project/image \145 --region us-central1146```147148See: `references/gcloud-platform.md`149150## Reference Navigation151152### Cloudflare Platform153- `cloudflare-platform.md` - Edge computing overview, key components154- `cloudflare-workers-basics.md` - Getting started, handler types, basic patterns155- `cloudflare-workers-advanced.md` - Advanced patterns, performance, optimization156- `cloudflare-workers-apis.md` - Runtime APIs, bindings, integrations157- `cloudflare-r2-storage.md` - R2 object storage, S3 compatibility, best practices158- `cloudflare-d1-kv.md` - D1 SQLite database, KV store, use cases159- `browser-rendering.md` - Puppeteer/Playwright automation on Cloudflare160161### Docker Containerization162- `docker-basics.md` - Core concepts, Dockerfile, images, containers163- `docker-compose.md` - Multi-container apps, networking, volumes164165### Google Cloud Platform166- `gcloud-platform.md` - GCP overview, gcloud CLI, authentication167- `gcloud-services.md` - Compute Engine, GKE, Cloud Run, App Engine168169### Python Utilities170- `scripts/cloudflare-deploy.py` - Automate Cloudflare Worker deployments171- `scripts/docker-optimize.py` - Analyze and optimize Dockerfiles172173## Common Workflows174175### Edge + Container Hybrid176177```yaml178# Cloudflare Workers (API Gateway)179# -> Docker containers on Cloud Run (Backend Services)180# -> R2 (Object Storage)181182# Benefits:183# - Edge caching and routing184# - Containerized business logic185# - Global distribution186```187188### Multi-Stage Docker Build189190```dockerfile191# Build stage192FROM node:20-alpine AS build193WORKDIR /app194COPY package*.json ./195RUN npm ci196COPY . .197RUN npm run build198199# Production stage200FROM node:20-alpine201WORKDIR /app202COPY --from=build /app/dist ./dist203COPY --from=build /app/node_modules ./node_modules204USER node205CMD ["node", "dist/server.js"]206```207208### CI/CD Pipeline Pattern209210```yaml211# 1. Build: Docker multi-stage build212# 2. Test: Run tests in container213# 3. Push: Push to registry (GCR, Docker Hub)214# 4. Deploy: Deploy to Cloudflare Workers / Cloud Run215# 5. Verify: Health checks and smoke tests216```217218## Best Practices219220### Security221- Run containers as non-root user222- Use service account impersonation (GCP)223- Store secrets in environment variables, not code224- Scan images for vulnerabilities (Docker Scout)225- Use API tokens with minimal permissions226227### Performance228- Multi-stage Docker builds to reduce image size229- Edge caching with Cloudflare KV230- Use R2 for zero egress cost storage231- Implement health checks for containers232- Set appropriate timeouts and resource limits233234### Cost Optimization235- Use Cloudflare R2 instead of S3 for large egress236- Implement caching strategies (edge + KV)237- Right-size container resources238- Use sustained use discounts (GCP)239- Monitor usage with cloud provider dashboards240241### Development242- Use Docker Compose for local development243- Wrangler dev for local Worker testing244- Named gcloud configurations for multi-environment245- Version control infrastructure code246- Implement automated testing in CI/CD247248## Decision Matrix249250| Need | Choose |251|------|--------|252| Sub-50ms latency globally | Cloudflare Workers |253| Large file storage (zero egress) | Cloudflare R2 |254| SQL database (global reads) | Cloudflare D1 |255| Containerized workloads | Docker + Cloud Run/GKE |256| Enterprise Kubernetes | GKE |257| Managed relational DB | Cloud SQL |258| Static site + API | Cloudflare Pages |259| WebSocket/real-time | Cloudflare Durable Objects |260| ML/AI pipelines | GCP Vertex AI |261| Browser automation | Cloudflare Browser Rendering |262263## Resources264265- **Cloudflare Docs:** https://developers.cloudflare.com266- **Docker Docs:** https://docs.docker.com267- **GCP Docs:** https://cloud.google.com/docs268- **Wrangler CLI:** https://developers.cloudflare.com/workers/wrangler/269- **gcloud CLI:** https://cloud.google.com/sdk/gcloud270271## Implementation Checklist272273### Cloudflare Workers274- [ ] Install Wrangler CLI275- [ ] Create Worker project276- [ ] Configure wrangler.toml (bindings, routes)277- [ ] Test locally with `wrangler dev`278- [ ] Deploy with `wrangler deploy`279280### Docker281- [ ] Write Dockerfile with multi-stage builds282- [ ] Create .dockerignore file283- [ ] Test build locally284- [ ] Push to registry285- [ ] Deploy to target platform286287### Google Cloud288- [ ] Install gcloud CLI289- [ ] Authenticate with service account290- [ ] Create project and enable APIs291- [ ] Configure IAM permissions292- [ ] Deploy and monitor resources