[IMPORTANT] Use TaskCreate to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI may ask user whether to skip.
Quick Summary
Goal: Deploy and manage cloud infrastructure across Cloudflare (Workers, R2, D1), Docker containers, and Google Cloud Platform.
Workflow:
- Platform Selection — Choose Cloudflare (edge/low-latency), Docker (containers/microservices), or GCP (enterprise/K8s)
- Project Setup — Initialize with Wrangler CLI, Dockerfile, or gcloud CLI
- Local Development — Test locally before deploying
- Deploy & Verify — Deploy to target platform with health checks
Key Rules:
- Run containers as non-root user; scan images for vulnerabilities
- Use multi-stage Docker builds to minimize image size
- Store secrets in environment variables, never in code
- Use R2 over S3 when zero egress cost matters
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
Related
databases
easyplatform-backend
IMPORTANT Task Planning Notes (MUST FOLLOW)
- Always plan and break work into many small todo tasks
- Always add a final review todo task to verify work quality and identify fixes/enhancements
1---2name: devops3description: [DevOps] Deploy and manage cloud infrastructure on Cloudflare (Workers, R2, D1, KV, Pages, Durable Objects, Browser Rendering), Docker containers, and Google Cloud Platform (Compute Engine, GKE, Cloud Run, App Engine, Cloud Storage). Use when deploying serverless functions to the edge, configuring edge computing solutions, managing Docker containers and images, setting up CI/CD pipelines, optimizing cloud infrastructure costs, implementing global caching strategies, working with cloud databases, or building cloud-native applications.4license: MIT5---67> **[IMPORTANT]** Use `TaskCreate` to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI may ask user whether to skip.89## Quick Summary1011**Goal:** Deploy and manage cloud infrastructure across Cloudflare (Workers, R2, D1), Docker containers, and Google Cloud Platform.1213**Workflow:**14151. **Platform Selection** — Choose Cloudflare (edge/low-latency), Docker (containers/microservices), or GCP (enterprise/K8s)162. **Project Setup** — Initialize with Wrangler CLI, Dockerfile, or gcloud CLI173. **Local Development** — Test locally before deploying184. **Deploy & Verify** — Deploy to target platform with health checks1920**Key Rules:**2122- Run containers as non-root user; scan images for vulnerabilities23- Use multi-stage Docker builds to minimize image size24- Store secrets in environment variables, never in code25- Use R2 over S3 when zero egress cost matters2627# DevOps Skill2829Comprehensive guide for deploying and managing cloud infrastructure across Cloudflare edge platform, Docker containerization, and Google Cloud Platform.3031## When to Use This Skill3233Use this skill when:3435- Deploying serverless applications to Cloudflare Workers36- Containerizing applications with Docker37- Managing Google Cloud infrastructure with gcloud CLI38- Setting up CI/CD pipelines across platforms39- Optimizing cloud infrastructure costs40- Implementing multi-region deployments41- Building edge-first architectures42- Managing container orchestration with Kubernetes43- Configuring cloud storage solutions (R2, Cloud Storage)44- Automating infrastructure with scripts and IaC4546## Platform Selection Guide4748### When to Use Cloudflare4950**Best For:**5152- Edge-first applications with global distribution53- Ultra-low latency requirements (<50ms)54- Static sites with serverless functions55- Zero egress cost scenarios (R2 storage)56- WebSocket/real-time applications (Durable Objects)57- AI/ML at the edge (Workers AI)5859**Key Products:**6061- Workers (serverless functions)62- R2 (object storage, S3-compatible)63- D1 (SQLite database with global replication)64- KV (key-value store)65- Pages (static hosting + functions)66- Durable Objects (stateful compute)67- Browser Rendering (headless browser automation)6869**Cost Profile:** Pay-per-request, generous free tier, zero egress fees7071### When to Use Docker7273**Best For:**7475- Local development consistency76- Microservices architectures77- Multi-language stack applications78- Traditional VPS/VM deployments79- Kubernetes orchestration80- CI/CD build environments81- Database containerization (dev/test)8283**Key Capabilities:**8485- Application isolation and portability86- Multi-stage builds for optimization87- Docker Compose for multi-container apps88- Volume management for data persistence89- Network configuration and service discovery90- Cross-platform compatibility (amd64, arm64)9192**Cost Profile:** Infrastructure cost only (compute + storage)9394### When to Use Google Cloud9596**Best For:**9798- Enterprise-scale applications99- Data analytics and ML pipelines (BigQuery, Vertex AI)100- Hybrid/multi-cloud deployments101- Kubernetes at scale (GKE)102- Managed databases (Cloud SQL, Firestore, Spanner)103- Complex IAM and compliance requirements104105**Key Services:**106107- Compute Engine (VMs)108- GKE (managed Kubernetes)109- Cloud Run (containerized serverless)110- App Engine (PaaS)111- Cloud Storage (object storage)112- Cloud SQL (managed databases)113114**Cost Profile:** Varied pricing, sustained use discounts, committed use contracts115116## Quick Start117118### Cloudflare Workers119120```bash121# Install Wrangler CLI122npm install -g wrangler123124# Create and deploy Worker125wrangler init my-worker126cd my-worker127wrangler deploy128```129130See: `references/cloudflare-workers-basics.md`131132### Docker Container133134```bash135# Create Dockerfile136cat > Dockerfile <<EOF137FROM node:20-alpine138WORKDIR /app139COPY package*.json ./140RUN npm ci --production141COPY . .142EXPOSE 3000143CMD ["node", "server.js"]144EOF145146# Build and run147docker build -t myapp .148docker run -p 3000:3000 myapp149```150151See: `references/docker-basics.md`152153### Google Cloud Deployment154155```bash156# Install and authenticate157curl https://sdk.cloud.google.com | bash158gcloud init159gcloud auth login160161# Deploy to Cloud Run162gcloud run deploy my-service \163 --image gcr.io/project/image \164 --region us-central1165```166167See: `references/gcloud-platform.md`168169## Reference Navigation170171### Cloudflare Platform172173- `cloudflare-platform.md` - Edge computing overview, key components174- `cloudflare-workers-basics.md` - Getting started, handler types, basic patterns175- `cloudflare-workers-advanced.md` - Advanced patterns, performance, optimization176- `cloudflare-workers-apis.md` - Runtime APIs, bindings, integrations177- `cloudflare-r2-storage.md` - R2 object storage, S3 compatibility, best practices178- `cloudflare-d1-kv.md` - D1 SQLite database, KV store, use cases179- `browser-rendering.md` - Puppeteer/Playwright automation on Cloudflare180181### Docker Containerization182183- `docker-basics.md` - Core concepts, Dockerfile, images, containers184- `docker-compose.md` - Multi-container apps, networking, volumes185186### Google Cloud Platform187188- `gcloud-platform.md` - GCP overview, gcloud CLI, authentication189- `gcloud-services.md` - Compute Engine, GKE, Cloud Run, App Engine190191### Python Utilities192193- `scripts/cloudflare-deploy.py` - Automate Cloudflare Worker deployments194- `scripts/docker-optimize.py` - Analyze and optimize Dockerfiles195196## Common Workflows197198### Edge + Container Hybrid199200```yaml201# Cloudflare Workers (API Gateway)202# -> Docker containers on Cloud Run (Backend Services)203# -> R2 (Object Storage)204205# Benefits:206# - Edge caching and routing207# - Containerized business logic208# - Global distribution209```210211### Multi-Stage Docker Build212213```dockerfile214# Build stage215FROM node:20-alpine AS build216WORKDIR /app217COPY package*.json ./218RUN npm ci219COPY . .220RUN npm run build221222# Production stage223FROM node:20-alpine224WORKDIR /app225COPY --from=build /app/dist ./dist226COPY --from=build /app/node_modules ./node_modules227USER node228CMD ["node", "dist/server.js"]229```230231### CI/CD Pipeline Pattern232233```yaml234# 1. Build: Docker multi-stage build235# 2. Test: Run tests in container236# 3. Push: Push to registry (GCR, Docker Hub)237# 4. Deploy: Deploy to Cloudflare Workers / Cloud Run238# 5. Verify: Health checks and smoke tests239```240241## Best Practices242243### Security244245- Run containers as non-root user246- Use service account impersonation (GCP)247- Store secrets in environment variables, not code248- Scan images for vulnerabilities (Docker Scout)249- Use API tokens with minimal permissions250251### Performance252253- Multi-stage Docker builds to reduce image size254- Edge caching with Cloudflare KV255- Use R2 for zero egress cost storage256- Implement health checks for containers257- Set appropriate timeouts and resource limits258259### Cost Optimization260261- Use Cloudflare R2 instead of S3 for large egress262- Implement caching strategies (edge + KV)263- Right-size container resources264- Use sustained use discounts (GCP)265- Monitor usage with cloud provider dashboards266267### Development268269- Use Docker Compose for local development270- Wrangler dev for local Worker testing271- Named gcloud configurations for multi-environment272- Version control infrastructure code273- Implement automated testing in CI/CD274275## Decision Matrix276277| Need | Choose |278| -------------------------------- | ---------------------------- |279| Sub-50ms latency globally | Cloudflare Workers |280| Large file storage (zero egress) | Cloudflare R2 |281| SQL database (global reads) | Cloudflare D1 |282| Containerized workloads | Docker + Cloud Run/GKE |283| Enterprise Kubernetes | GKE |284| Managed relational DB | Cloud SQL |285| Static site + API | Cloudflare Pages |286| WebSocket/real-time | Cloudflare Durable Objects |287| ML/AI pipelines | GCP Vertex AI |288| Browser automation | Cloudflare Browser Rendering |289290## Resources291292- **Cloudflare Docs:** https://developers.cloudflare.com293- **Docker Docs:** https://docs.docker.com294- **GCP Docs:** https://cloud.google.com/docs295- **Wrangler CLI:** https://developers.cloudflare.com/workers/wrangler/296- **gcloud CLI:** https://cloud.google.com/sdk/gcloud297298## Implementation Checklist299300### Cloudflare Workers301302- [ ] Install Wrangler CLI303- [ ] Create Worker project304- [ ] Configure wrangler.toml (bindings, routes)305- [ ] Test locally with `wrangler dev`306- [ ] Deploy with `wrangler deploy`307308### Docker309310- [ ] Write Dockerfile with multi-stage builds311- [ ] Create .dockerignore file312- [ ] Test build locally313- [ ] Push to registry314- [ ] Deploy to target platform315316### Google Cloud317318- [ ] Install gcloud CLI319- [ ] Authenticate with service account320- [ ] Create project and enable APIs321- [ ] Configure IAM permissions322- [ ] Deploy and monitor resources323324## Related325326- `databases`327- `easyplatform-backend`328329---330331**IMPORTANT Task Planning Notes (MUST FOLLOW)**332333- Always plan and break work into many small todo tasks334- Always add a final review todo task to verify work quality and identify fixes/enhancements