<< All versions
Skill v1.0.1
Automated scan100/100raheesahmed/sajicode/devops
2 files
──Details
PublishedJuly 5, 2026 at 07:27 AM
Content Hashsha256:c7c6fc7fc082a867...
Git SHA10fe7b36771f
Bump Typepatch
──Files
Files (1 file, 4.9 KB)
SKILL.md4.9 KBactive
SKILL.md · 197 lines · 4.9 KB
version: "1.0.1" name: devops-patterns description: Cloud-native DevOps and infrastructure automation. Covers Docker multi-stage builds, Kubernetes deployments, GitHub Actions CI/CD, Vercel/AWS/GCP deployment, monitoring with Prometheus and Grafana, logging, health checks, infrastructure as code, and production readiness checklists. Use when deploying, containerizing, or setting up CI/CD pipelines.
Cloud-Native DevOps
Docker
Multi-Stage Build (Node.js)
dockerfile
FROM node:20-alpine AS depsWORKDIR /appCOPY package*.json ./RUN npm ci --omit=devFROM node:20-alpine AS builderWORKDIR /appCOPY package*.json ./RUN npm ciCOPY . .RUN npm run buildFROM node:20-alpine AS runnerWORKDIR /appENV NODE_ENV=productionRUN addgroup --system --gid 1001 appgroup && adduser --system --uid 1001 appuserCOPY --from=deps /app/node_modules ./node_modulesCOPY --from=builder /app/dist ./distCOPY --from=builder /app/package.json ./USER appuserEXPOSE 3000HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:3000/health || exit 1CMD ["node", "dist/index.js"]
Docker Compose (dev environment)
yaml
services:app:build: .ports: ["3000:3000"]environment:DATABASE_URL: postgresql://postgres:postgres@db:5432/appREDIS_URL: redis://redis:6379depends_on:db: { condition: service_healthy }redis: { condition: service_started }volumes: ["./src:/app/src"]db:image: postgres:16-alpineenvironment:POSTGRES_DB: appPOSTGRES_PASSWORD: postgresports: ["5432:5432"]volumes: ["pgdata:/var/lib/postgresql/data"]healthcheck:test: ["CMD-SHELL", "pg_isready -U postgres"]interval: 5stimeout: 3sretries: 5redis:image: redis:7-alpineports: ["6379:6379"]volumes:pgdata:
GitHub Actions CI/CD
Full Pipeline
yaml
name: CI/CDon:push: { branches: [main] }pull_request: { branches: [main] }jobs:lint-and-test:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- uses: actions/setup-node@v4with: { node-version: 20, cache: npm }- run: npm ci- run: npm run lint- run: npm run typecheck- run: npm test -- --coverage- uses: actions/upload-artifact@v4with: { name: coverage, path: coverage/ }build:needs: lint-and-testruns-on: ubuntu-lateststeps:- uses: actions/checkout@v4- uses: actions/setup-node@v4with: { node-version: 20, cache: npm }- run: npm ci- run: npm run builddeploy:needs: buildif: github.ref == 'refs/heads/main'runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- name: Deploy to Verceluses: amondnet/vercel-action@v25with:vercel-token: ${{ secrets.VERCEL_TOKEN }}vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}vercel-args: "--prod"
Deployment Platforms
Vercel (Next.js / Frontend)
bash
npx vercel --prod# Environment variables: vercel env add SECRET_KEY production
Railway / Render (Backend APIs)
json
{"scripts": {"start": "node dist/index.js","build": "tsc"}}
AWS (ECS Fargate)
bash
# Build and push to ECRaws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URIdocker build -t $ECR_URI:latest .docker push $ECR_URI:latestaws ecs update-service --cluster prod --service app --force-new-deployment
Monitoring & Observability
Health Check Endpoint
ts
app.get("/health", async (req, res) => {const checks = {uptime: process.uptime(),timestamp: new Date().toISOString(),database: await checkDatabase(),memory: process.memoryUsage(),};const healthy = checks.database === "ok";res.status(healthy ? 200 : 503).json({ status: healthy ? "healthy" : "unhealthy", ...checks });});async function checkDatabase(): Promise<string> {try {await prisma.$queryRaw`SELECT 1`;return "ok";} catch { return "error"; }}
Structured Logging
ts
import pino from "pino";const logger = pino({level: process.env.LOG_LEVEL || "info",transport: process.env.NODE_ENV === "development"? { target: "pino-pretty", options: { colorize: true } }: undefined,redact: ["req.headers.authorization", "req.body.password"],});
Production Readiness Checklist
- [ ] Build passes, all tests green
- [ ] Environment variables documented and set
- [ ] Database migrations applied
- [ ] Health check endpoint at
/health - [ ] Structured logging (JSON format)
- [ ] Error monitoring configured (Sentry)
- [ ] HTTPS enforced, HSTS enabled
- [ ] Rate limiting on auth endpoints
- [ ] Graceful shutdown handler
- [ ] Backup strategy for database
- [ ] Monitoring alerts configured
- [ ] README deployment instructions updated