[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70FSZD9DQKR5PBDHRHWMBWF":3,"skill-same:01M70FSZD9DQKR5PBDHRHWMBWF":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M70FSZD9DQKR5PBDHRHWMBWF","deployment-patterns",null,"Deployment workflows, CI\u002FCD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up CI\u002FCD, containerizing an app, or checking production readiness before a release.","mdnaimul22\u002Fhuman-skills","mdnaimul22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F64520358?v=4","01M70FH95MH2H796Q01TYSFZ03","Naimul","01M70FH96798CQR4YHA13F17GA",3,"MIT","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Fdeployment-patterns\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"deployment","deployment patterns","patterns","docker containerization","health","use","applications","docker","for","containerization","CI\u002FCD","release","strategies","when","workflows","ci","up","pipeline","production readiness","app","2026-11-10 10:12:30",false,"---\nname: deployment-patterns\ndescription: Deployment workflows, CI\u002FCD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up CI\u002FCD, containerizing an app, or checking production readiness before a release.\nmetadata:\n  origin: ECC\n---\n\n# Deployment Patterns\n\nProduction deployment workflows and CI\u002FCD best practices.\n\n## When to Activate\n\n- Setting up CI\u002FCD pipelines\n- Dockerizing an application\n- Planning deployment strategy (blue-green, canary, rolling)\n- Implementing health checks and readiness probes\n- Preparing for a production release\n- Configuring environment-specific settings\n\n## Deployment Strategies\n\n### Rolling Deployment (Default)\n\nReplace instances gradually — old and new versions run simultaneously during rollout.\n\n```\nInstance 1: v1 → v2  (update first)\nInstance 2: v1        (still running v1)\nInstance 3: v1        (still running v1)\n\nInstance 1: v2\nInstance 2: v1 → v2  (update second)\nInstance 3: v1\n\nInstance 1: v2\nInstance 2: v2\nInstance 3: v1 → v2  (update last)\n```\n\n**Pros:** Zero downtime, gradual rollout\n**Cons:** Two versions run simultaneously — requires backward-compatible changes\n**Use when:** Standard deployments, backward-compatible changes\n\n### Blue-Green Deployment\n\nRun two identical environments. Switch traffic atomically.\n\n```\nBlue  (v1) ← traffic\nGreen (v2)   idle, running new version\n\n# After verification:\nBlue  (v1)   idle (becomes standby)\nGreen (v2) ← traffic\n```\n\n**Pros:** Instant rollback (switch back to blue), clean cutover\n**Cons:** Requires 2x infrastructure during deployment\n**Use when:** Critical services, zero-tolerance for issues\n\n### Canary Deployment\n\nRoute a small percentage of traffic to the new version first.\n\n```\nv1: 95% of traffic\nv2:  5% of traffic  (canary)\n\n# If metrics look good:\nv1: 50% of traffic\nv2: 50% of traffic\n\n# Final:\nv2: 100% of traffic\n```\n\n**Pros:** Catches issues with real traffic before full rollout\n**Cons:** Requires traffic splitting infrastructure, monitoring\n**Use when:** High-traffic services, risky changes, feature flags\n\n## Docker\n\n### Multi-Stage Dockerfile (Node.js)\n\n```dockerfile\n# Stage 1: Install dependencies\nFROM node:22-alpine AS deps\nWORKDIR \u002Fapp\nCOPY package.json package-lock.json .\u002F\nRUN npm ci --production=false\n\n# Stage 2: Build\nFROM node:22-alpine AS builder\nWORKDIR \u002Fapp\nCOPY --from=deps \u002Fapp\u002Fnode_modules .\u002Fnode_modules\nCOPY . .\nRUN npm run build\nRUN npm prune --production\n\n# Stage 3: Production image\nFROM node:22-alpine AS runner\nWORKDIR \u002Fapp\n\nRUN addgroup -g 1001 -S appgroup && adduser -S appuser -u 1001\nUSER appuser\n\nCOPY --from=builder --chown=appuser:appgroup \u002Fapp\u002Fnode_modules .\u002Fnode_modules\nCOPY --from=builder --chown=appuser:appgroup \u002Fapp\u002Fdist .\u002Fdist\nCOPY --from=builder --chown=appuser:appgroup \u002Fapp\u002Fpackage.json .\u002F\n\nENV NODE_ENV=production\nEXPOSE 3000\n\nHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\\n  CMD wget --no-verbose --tries=1 --spider http:\u002F\u002Flocalhost:3000\u002Fhealth || exit 1\n\nCMD [\"node\", \"dist\u002Fserver.js\"]\n```\n\n### Multi-Stage Dockerfile (Go)\n\n```dockerfile\nFROM golang:1.22-alpine AS builder\nWORKDIR \u002Fapp\nCOPY go.mod go.sum .\u002F\nRUN go mod download\nCOPY . .\nRUN CGO_ENABLED=0 GOOS=linux go build -ldflags=\"-s -w\" -o \u002Fserver .\u002Fcmd\u002Fserver\n\nFROM alpine:3.19 AS runner\nRUN apk --no-cache add ca-certificates\nRUN adduser -D -u 1001 appuser\nUSER appuser\n\nCOPY --from=builder \u002Fserver \u002Fserver\n\nEXPOSE 8080\nHEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http:\u002F\u002Flocalhost:8080\u002Fhealth || exit 1\nCMD [\"\u002Fserver\"]\n```\n\n### Multi-Stage Dockerfile (Python\u002FDjango)\n\n```dockerfile\nFROM python:3.12-slim AS builder\nWORKDIR \u002Fapp\nRUN pip install --no-cache-dir uv\nCOPY requirements.txt .\nRUN uv pip install --system --no-cache -r requirements.txt\n\nFROM python:3.12-slim AS runner\nWORKDIR \u002Fapp\n\nRUN useradd -r -u 1001 appuser\nUSER appuser\n\nCOPY --from=builder \u002Fusr\u002Flocal\u002Flib\u002Fpython3.12\u002Fsite-packages \u002Fusr\u002Flocal\u002Flib\u002Fpython3.12\u002Fsite-packages\nCOPY --from=builder \u002Fusr\u002Flocal\u002Fbin \u002Fusr\u002Flocal\u002Fbin\nCOPY . .\n\nENV PYTHONUNBUFFERED=1\nEXPOSE 8000\n\nHEALTHCHECK --interval=30s --timeout=3s CMD python -c \"import urllib.request; urllib.request.urlopen('http:\u002F\u002Flocalhost:8000\u002Fhealth\u002F')\" || exit 1\nCMD [\"gunicorn\", \"config.wsgi:application\", \"--bind\", \"0.0.0.0:8000\", \"--workers\", \"4\"]\n```\n\n### Docker Best Practices\n\n```\n# GOOD practices\n- Use specific version tags (node:22-alpine, not node:latest)\n- Multi-stage builds to minimize image size\n- Run as non-root user\n- Copy dependency files first (layer caching)\n- Use .dockerignore to exclude node_modules, .git, tests\n- Add HEALTHCHECK instruction\n- Set resource limits in docker-compose or k8s\n\n# BAD practices\n- Running as root\n- Using :latest tags\n- Copying entire repo in one COPY layer\n- Installing dev dependencies in production image\n- Storing secrets in image (use env vars or secrets manager)\n```\n\n## CI\u002FCD Pipeline\n\n### GitHub Actions (Standard Pipeline)\n\n```yaml\nname: CI\u002FCD\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: 22\n          cache: npm\n      - run: npm ci\n      - run: npm run lint\n      - run: npm run typecheck\n      - run: npm test -- --coverage\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with:\n          name: coverage\n          path: coverage\u002F\n\n  build:\n    needs: test\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs\u002Fheads\u002Fmain'\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: docker\u002Fsetup-buildx-action@v3\n      - uses: docker\u002Flogin-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - uses: docker\u002Fbuild-push-action@v5\n        with:\n          push: true\n          tags: ghcr.io\u002F${{ github.repository }}:${{ github.sha }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  deploy:\n    needs: build\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs\u002Fheads\u002Fmain'\n    environment: production\n    steps:\n      - name: Deploy to production\n        run: |\n          # Platform-specific deployment command\n          # Railway: railway up\n          # Vercel: vercel --prod\n          # K8s: kubectl set image deployment\u002Fapp app=ghcr.io\u002F${{ github.repository }}:${{ github.sha }}\n          echo \"Deploying ${{ github.sha }}\"\n```\n\n### Pipeline Stages\n\n```\nPR opened:\n  lint → typecheck → unit tests → integration tests → preview deploy\n\nMerged to main:\n  lint → typecheck → unit tests → integration tests → build image → deploy staging → smoke tests → deploy production\n```\n\n## Health Checks\n\n### Health Check Endpoint\n\n```typescript\n\u002F\u002F Simple health check\napp.get(\"\u002Fhealth\", (req, res) => {\n  res.status(200).json({ status: \"ok\" });\n});\n\n\u002F\u002F Detailed health check (for internal monitoring)\napp.get(\"\u002Fhealth\u002Fdetailed\", async (req, res) => {\n  const checks = {\n    database: await checkDatabase(),\n    redis: await checkRedis(),\n    externalApi: await checkExternalApi(),\n  };\n\n  const allHealthy = Object.values(checks).every(c => c.status === \"ok\");\n\n  res.status(allHealthy ? 200 : 503).json({\n    status: allHealthy ? \"ok\" : \"degraded\",\n    timestamp: new Date().toISOString(),\n    version: process.env.APP_VERSION || \"unknown\",\n    uptime: process.uptime(),\n    checks,\n  });\n});\n\nasync function checkDatabase(): Promise\u003CHealthCheck> {\n  try {\n    await db.query(\"SELECT 1\");\n    return { status: \"ok\", latency_ms: 2 };\n  } catch (err) {\n    return { status: \"error\", message: \"Database unreachable\" };\n  }\n}\n```\n\n### Kubernetes Probes\n\n```yaml\nlivenessProbe:\n  httpGet:\n    path: \u002Fhealth\n    port: 3000\n  initialDelaySeconds: 10\n  periodSeconds: 30\n  failureThreshold: 3\n\nreadinessProbe:\n  httpGet:\n    path: \u002Fhealth\n    port: 3000\n  initialDelaySeconds: 5\n  periodSeconds: 10\n  failureThreshold: 2\n\nstartupProbe:\n  httpGet:\n    path: \u002Fhealth\n    port: 3000\n  initialDelaySeconds: 0\n  periodSeconds: 5\n  failureThreshold: 30    # 30 * 5s = 150s max startup time\n```\n\n## Environment Configuration\n\n### Twelve-Factor App Pattern\n\n```bash\n# All config via environment variables — never in code\nDATABASE_URL=postgres:\u002F\u002Fuser:pass@host:5432\u002Fdb\nREDIS_URL=redis:\u002F\u002Fhost:6379\u002F0\nAPI_KEY=${API_KEY}           # injected by secrets manager\nLOG_LEVEL=info\nPORT=3000\n\n# Environment-specific behavior\nNODE_ENV=production          # or staging, development\nAPP_ENV=production           # explicit app environment\n```\n\n### Configuration Validation\n\n```typescript\nimport { z } from \"zod\";\n\nconst envSchema = z.object({\n  NODE_ENV: z.enum([\"development\", \"staging\", \"production\"]),\n  PORT: z.coerce.number().default(3000),\n  DATABASE_URL: z.string().url(),\n  REDIS_URL: z.string().url(),\n  JWT_SECRET: z.string().min(32),\n  LOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n});\n\n\u002F\u002F Validate at startup — fail fast if config is wrong\nexport const env = envSchema.parse(process.env);\n```\n\n## Rollback Strategy\n\n### Instant Rollback\n\n```bash\n# Docker\u002FKubernetes: point to previous image\nkubectl rollout undo deployment\u002Fapp\n\n# Vercel: promote previous deployment\nvercel rollback\n\n# Railway: redeploy previous commit\nrailway up --commit \u003Cprevious-sha>\n\n# Database: rollback migration (if reversible)\nnpx prisma migrate resolve --rolled-back \u003Cmigration-name>\n```\n\n### Rollback Checklist\n\n- [ ] Previous image\u002Fartifact is available and tagged\n- [ ] Database migrations are backward-compatible (no destructive changes)\n- [ ] Feature flags can disable new features without deploy\n- [ ] Monitoring alerts configured for error rate spikes\n- [ ] Rollback tested in staging before production release\n\n## Production Readiness Checklist\n\nBefore any production deployment:\n\n### Application\n- [ ] All tests pass (unit, integration, E2E)\n- [ ] No hardcoded secrets in code or config files\n- [ ] Error handling covers all edge cases\n- [ ] Logging is structured (JSON) and does not contain PII\n- [ ] Health check endpoint returns meaningful status\n\n### Infrastructure\n- [ ] Docker image builds reproducibly (pinned versions)\n- [ ] Environment variables documented and validated at startup\n- [ ] Resource limits set (CPU, memory)\n- [ ] Horizontal scaling configured (min\u002Fmax instances)\n- [ ] SSL\u002FTLS enabled on all endpoints\n\n### Monitoring\n- [ ] Application metrics exported (request rate, latency, errors)\n- [ ] Alerts configured for error rate > threshold\n- [ ] Log aggregation set up (structured logs, searchable)\n- [ ] Uptime monitoring on health endpoint\n\n### Security\n- [ ] Dependencies scanned for CVEs\n- [ ] CORS configured for allowed origins only\n- [ ] Rate limiting enabled on public endpoints\n- [ ] Authentication and authorization verified\n- [ ] Security headers set (CSP, HSTS, X-Frame-Options)\n\n### Operations\n- [ ] Rollback plan documented and tested\n- [ ] Database migration tested against production-sized data\n- [ ] Runbook for common failure scenarios\n- [ ] On-call rotation and escalation path defined\n","# Deployment Patterns\n\nProduction deployment workflows and CI\u002FCD best practices.\n\n## When to Activate\n\n- Setting up CI\u002FCD pipelines\n- Dockerizing an application\n- Planning deployment strategy (blue-green, canary, rolling)\n- Implementing health checks and readiness probes\n- Preparing for a production release\n- Configuring environment-specific settings\n\n## Deployment Strategies\n\n### Rolling Deployment (Default)\n\nReplace instances gradually — old and new versions run simultaneously during rollout.\n\n```\nInstance 1: v1 → v2  (update first)\nInstance 2: v1        (still running v1)\nInstance 3: v1        (still running v1)\n\nInstance 1: v2\nInstance 2: v1 → v2  (update second)\nInstance 3: v1\n\nInstance 1: v2\nInstance 2: v2\nInstance 3: v1 → v2  (update last)\n```\n\n**Pros:** Zero downtime, gradual rollout\n**Cons:** Two versions run simultaneously — requires backward-compatible changes\n**Use when:** Standard deployments, backward-compatible changes\n\n### Blue-Green Deployment\n\nRun two identical environments. Switch traffic atomically.\n\n```\nBlue  (v1) ← traffic\nGreen (v2)   idle, running new version\n\n# After verification:\nBlue  (v1)   idle (becomes standby)\nGreen (v2) ← traffic\n```\n\n**Pros:** Instant rollback (switch back to blue), clean cutover\n**Cons:** Requires 2x infrastructure during deployment\n**Use when:** Critical services, zero-tolerance for issues\n\n### Canary Deployment\n\nRoute a small percentage of traffic to the new version first.\n\n```\nv1: 95% of traffic\nv2:  5% of traffic  (canary)\n\n# If metrics look good:\nv1: 50% of traffic\nv2: 50% of traffic\n\n# Final:\nv2: 100% of traffic\n```\n\n**Pros:** Catches issues with real traffic before full rollout\n**Cons:** Requires traffic splitting infrastructure, monitoring\n**Use when:** High-traffic services, risky changes, feature flags\n\n## Docker\n\n### Multi-Stage Dockerfile (Node.js)\n\n```dockerfile\n# Stage 1: Install dependencies\nFROM node:22-alpine AS deps\nWORKDIR \u002Fapp\nCOPY package.json package-lock.json .\u002F\nRUN npm ci --production=false\n\n# Stage 2: Build\nFROM node:22-alpine AS builder\nWORKDIR \u002Fapp\nCOPY --from=deps \u002Fapp\u002Fnode_modules .\u002Fnode_modules\nCOPY . .\nRUN npm run build\nRUN npm prune --production\n\n# Stage 3: Production image\nFROM node:22-alpine AS runner\nWORKDIR \u002Fapp\n\nRUN addgroup -g 1001 -S appgroup && adduser -S appuser -u 1001\nUSER appuser\n\nCOPY --from=builder --chown=appuser:appgroup \u002Fapp\u002Fnode_modules .\u002Fnode_modules\nCOPY --from=builder --chown=appuser:appgroup \u002Fapp\u002Fdist .\u002Fdist\nCOPY --from=builder --chown=appuser:appgroup \u002Fapp\u002Fpackage.json .\u002F\n\nENV NODE_ENV=production\nEXPOSE 3000\n\nHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\\n  CMD wget --no-verbose --tries=1 --spider http:\u002F\u002Flocalhost:3000\u002Fhealth || exit 1\n\nCMD [\"node\", \"dist\u002Fserver.js\"]\n```\n\n### Multi-Stage Dockerfile (Go)\n\n```dockerfile\nFROM golang:1.22-alpine AS builder\nWORKDIR \u002Fapp\nCOPY go.mod go.sum .\u002F\nRUN go mod download\nCOPY . .\nRUN CGO_ENABLED=0 GOOS=linux go build -ldflags=\"-s -w\" -o \u002Fserver .\u002Fcmd\u002Fserver\n\nFROM alpine:3.19 AS runner\nRUN apk --no-cache add ca-certificates\nRUN adduser -D -u 1001 appuser\nUSER appuser\n\nCOPY --from=builder \u002Fserver \u002Fserver\n\nEXPOSE 8080\nHEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http:\u002F\u002Flocalhost:8080\u002Fhealth || exit 1\nCMD [\"\u002Fserver\"]\n```\n\n### Multi-Stage Dockerfile (Python\u002FDjango)\n\n```dockerfile\nFROM python:3.12-slim AS builder\nWORKDIR \u002Fapp\nRUN pip install --no-cache-dir uv\nCOPY requirements.txt .\nRUN uv pip install --system --no-cache -r requirements.txt\n\nFROM python:3.12-slim AS runner\nWORKDIR \u002Fapp\n\nRUN useradd -r -u 1001 appuser\nUSER appuser\n\nCOPY --from=builder \u002Fusr\u002Flocal\u002Flib\u002Fpython3.12\u002Fsite-packages \u002Fusr\u002Flocal\u002Flib\u002Fpython3.12\u002Fsite-packages\nCOPY --from=builder \u002Fusr\u002Flocal\u002Fbin \u002Fusr\u002Flocal\u002Fbin\nCOPY . .\n\nENV PYTHONUNBUFFERED=1\nEXPOSE 8000\n\nHEALTHCHECK --interval=30s --timeout=3s CMD python -c \"import urllib.request; urllib.request.urlopen('http:\u002F\u002Flocalhost:8000\u002Fhealth\u002F')\" || exit 1\nCMD [\"gunicorn\", \"config.wsgi:application\", \"--bind\", \"0.0.0.0:8000\", \"--workers\", \"4\"]\n```\n\n### Docker Best Practices\n\n```\n# GOOD practices\n- Use specific version tags (node:22-alpine, not node:latest)\n- Multi-stage builds to minimize image size\n- Run as non-root user\n- Copy dependency files first (layer caching)\n- Use .dockerignore to exclude node_modules, .git, tests\n- Add HEALTHCHECK instruction\n- Set resource limits in docker-compose or k8s\n\n# BAD practices\n- Running as root\n- Using :latest tags\n- Copying entire repo in one COPY layer\n- Installing dev dependencies in production image\n- Storing secrets in image (use env vars or secrets manager)\n```\n\n## CI\u002FCD Pipeline\n\n### GitHub Actions (Standard Pipeline)\n\n```yaml\nname: CI\u002FCD\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: 22\n          cache: npm\n      - run: npm ci\n      - run: npm run lint\n      - run: npm run typecheck\n      - run: npm test -- --coverage\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with:\n          name: coverage\n          path: coverage\u002F\n\n  build:\n    needs: test\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs\u002Fheads\u002Fmain'\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: docker\u002Fsetup-buildx-action@v3\n      - uses: docker\u002Flogin-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - uses: docker\u002Fbuild-push-action@v5\n        with:\n          push: true\n          tags: ghcr.io\u002F${{ github.repository }}:${{ github.sha }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  deploy:\n    needs: build\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs\u002Fheads\u002Fmain'\n    environment: production\n    steps:\n      - name: Deploy to production\n        run: |\n          # Platform-specific deployment command\n          # Railway: railway up\n          # Vercel: vercel --prod\n          # K8s: kubectl set image deployment\u002Fapp app=ghcr.io\u002F${{ github.repository }}:${{ github.sha }}\n          echo \"Deploying ${{ github.sha }}\"\n```\n\n### Pipeline Stages\n\n```\nPR opened:\n  lint → typecheck → unit tests → integration tests → preview deploy\n\nMerged to main:\n  lint → typecheck → unit tests → integration tests → build image → deploy staging → smoke tests → deploy production\n```\n\n## Health Checks\n\n### Health Check Endpoint\n\n```typescript\n\u002F\u002F Simple health check\napp.get(\"\u002Fhealth\", (req, res) => {\n  res.status(200).json({ status: \"ok\" });\n});\n\n\u002F\u002F Detailed health check (for internal monitoring)\napp.get(\"\u002Fhealth\u002Fdetailed\", async (req, res) => {\n  const checks = {\n    database: await checkDatabase(),\n    redis: await checkRedis(),\n    externalApi: await checkExternalApi(),\n  };\n\n  const allHealthy = Object.values(checks).every(c => c.status === \"ok\");\n\n  res.status(allHealthy ? 200 : 503).json({\n    status: allHealthy ? \"ok\" : \"degraded\",\n    timestamp: new Date().toISOString(),\n    version: process.env.APP_VERSION || \"unknown\",\n    uptime: process.uptime(),\n    checks,\n  });\n});\n\nasync function checkDatabase(): Promise\u003CHealthCheck> {\n  try {\n    await db.query(\"SELECT 1\");\n    return { status: \"ok\", latency_ms: 2 };\n  } catch (err) {\n    return { status: \"error\", message: \"Database unreachable\" };\n  }\n}\n```\n\n### Kubernetes Probes\n\n```yaml\nlivenessProbe:\n  httpGet:\n    path: \u002Fhealth\n    port: 3000\n  initialDelaySeconds: 10\n  periodSeconds: 30\n  failureThreshold: 3\n\nreadinessProbe:\n  httpGet:\n    path: \u002Fhealth\n    port: 3000\n  initialDelaySeconds: 5\n  periodSeconds: 10\n  failureThreshold: 2\n\nstartupProbe:\n  httpGet:\n    path: \u002Fhealth\n    port: 3000\n  initialDelaySeconds: 0\n  periodSeconds: 5\n  failureThreshold: 30    # 30 * 5s = 150s max startup time\n```\n\n## Environment Configuration\n\n### Twelve-Factor App Pattern\n\n```bash\n# All config via environment variables — never in code\nDATABASE_URL=postgres:\u002F\u002Fuser:pass@host:5432\u002Fdb\nREDIS_URL=redis:\u002F\u002Fhost:6379\u002F0\nAPI_KEY=${API_KEY}           # injected by secrets manager\nLOG_LEVEL=info\nPORT=3000\n\n# Environment-specific behavior\nNODE_ENV=production          # or staging, development\nAPP_ENV=production           # explicit app environment\n```\n\n### Configuration Validation\n\n```typescript\nimport { z } from \"zod\";\n\nconst envSchema = z.object({\n  NODE_ENV: z.enum([\"development\", \"staging\", \"production\"]),\n  PORT: z.coerce.number().default(3000),\n  DATABASE_URL: z.string().url(),\n  REDIS_URL: z.string().url(),\n  JWT_SECRET: z.string().min(32),\n  LOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n});\n\n\u002F\u002F Validate at startup — fail fast if config is wrong\nexport const env = envSchema.parse(process.env);\n```\n\n## Rollback Strategy\n\n### Instant Rollback\n\n```bash\n# Docker\u002FKubernetes: point to previous image\nkubectl rollout undo deployment\u002Fapp\n\n# Vercel: promote previous deployment\nvercel rollback\n\n# Railway: redeploy previous commit\nrailway up --commit \u003Cprevious-sha>\n\n# Database: rollback migration (if reversible)\nnpx prisma migrate resolve --rolled-back \u003Cmigration-name>\n```\n\n### Rollback Checklist\n\n- [ ] Previous image\u002Fartifact is available and tagged\n- [ ] Database migrations are backward-compatible (no destructive changes)\n- [ ] Feature flags can disable new features without deploy\n- [ ] Monitoring alerts configured for error rate spikes\n- [ ] Rollback tested in staging before production release\n\n## Production Readiness Checklist\n\nBefore any production deployment:\n\n### Application\n- [ ] All tests pass (unit, integration, E2E)\n- [ ] No hardcoded secrets in code or config files\n- [ ] Error handling covers all edge cases\n- [ ] Logging is structured (JSON) and does not contain PII\n- [ ] Health check endpoint returns meaningful status\n\n### Infrastructure\n- [ ] Docker image builds reproducibly (pinned versions)\n- [ ] Environment variables documented and validated at startup\n- [ ] Resource limits set (CPU, memory)\n- [ ] Horizontal scaling configured (min\u002Fmax instances)\n- [ ] SSL\u002FTLS enabled on all endpoints\n\n### Monitoring\n- [ ] Application metrics exported (request rate, latency, errors)\n- [ ] Alerts configured for error rate > threshold\n- [ ] Log aggregation set up (structured logs, searchable)\n- [ ] Uptime monitoring on health endpoint\n\n### Security\n- [ ] Dependencies scanned for CVEs\n- [ ] CORS configured for allowed origins only\n- [ ] Rate limiting enabled on public endpoints\n- [ ] Authentication and authorization verified\n- [ ] Security headers set (CSP, HSTS, X-Frame-Options)\n\n### Operations\n- [ ] Rollback plan documented and tested\n- [ ] Database migration tested against production-sized data\n- [ ] Runbook for common failure scenarios\n- [ ] On-call rotation and escalation path defined\n",{"name":5,"metadata":49,"description":7},{"origin":50},"ECC","main","74715deacdc69119d739f38916f8ee4f0f979ebf","skills\u002Fstorage\u002Faffaan-m_ECC\u002Fdeployment-patterns",0,"https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills","https:\u002F\u002Fgithub.com\u002Fmdnaimul22","AI Agents Workflows Automation | Specializing in Python, FastAPI, MCP Agents & Custom ERP.","2026-11-11 21:16:57",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add mdnaimul22\u002Fhuman-skills --skill deployment-patterns",{"tool":65,"command":66},"bunx","bunx skills add mdnaimul22\u002Fhuman-skills --skill deployment-patterns",{"tool":68,"command":69},"pnpm","pnpm dlx skills add mdnaimul22\u002Fhuman-skills --skill deployment-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Fdeployment-patterns\u002FSKILL.md",true,[],[74,82,109,130,149,164],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":81},"01M72JT3YP1SQHD0MANGDXQ4RT","higgsfield-websites","Build, edit, and deploy full-stack websites, apps and games via the Higgsfield CLI (`higgsfield website …`). Each is a React 19 + TanStack Start SSR app in one Cloudflare Worker (D1\u002FR2\u002FKV\u002FDO\u002FContainers). THREE product types, picked via `--type` on create: `website` (standalone, no Higgsfield integration — references\u002Fwebsite-flow.md), `app` (Sign in with Higgsfield + fnf SDK, Quanta — references\u002Fapp-flow.md), `game` (realtime multiplayer rooms — references\u002Fgame-flow.md). Routes to the right flow; each carries its own rules and deploy\u002Fpublish gates.\nUse when: \"build me a website\", \"make a landing page\", \"create a web app\", \"build a SaaS dashboard \u002F portfolio\", \"make me a game\", \"deploy this site\", \"publish\". Also owns GAME ART: \"make a spritesheet\", \"tileable texture\", \"animate a 3D character\", game music\u002FSFX — see the game-* references.\nNOT for: single image\u002Fvideo\u002Faudio generation (higgsfield-generate), product photos (higgsfield-product-photoshoot), marketplace cards (higgsfield-marketplace-cards).","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fhiggsfield-ai_skills\u002Fhiggsfield-websites\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":102,"publishedAt":44},"01M70JPK8HAXXA85P7Q8NKZZYG","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fwriting-skills\u002FSKILL.md",[88,91,96,99],{"categoryNo":89,"categoryName":90,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":92,"categoryName":93,"taxonomyType":94,"taxonomyTypeDesc":95},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",{"categoryNo":97,"categoryName":98,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":100,"categoryName":101,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",[103,104,105,24,29,106,107,37,108],"writing","writing skills","editing","Existing","new","work",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":120,"publishedAt":44},"01M70JP4PHBH1CQVVDWZ94W159","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fwriting-plans\u002FSKILL.md",[115,116,117],{"categoryNo":89,"categoryName":90,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":92,"categoryName":93,"taxonomyType":94,"taxonomyTypeDesc":95},{"categoryNo":118,"categoryName":119,"taxonomyType":94,"taxonomyTypeDesc":95},"01JBSEEDCAT000000000000030","开发工程师",[103,121,122,123,37,124,32,29,125,126,127,128,129],"writing plans","plans","you","code","requirements","task","multi","spec","multi-step task",{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":44},"01M70JNTYVGXFZT8PASZ844TH8","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fverification-before-completion\u002FSKILL.md",[],[137,138,139,140,141,142,29,143,144,145,37,146,108,147,148],"verification","verification before completion","complete","about","output","assertions","prs","evidence","claim","claims","commands","running",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":156,"publishedAt":44},"01M70JNGVSQDESWN0Q5BPJ875V","using-superpowers","Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fusing-superpowers\u002FSKILL.md",[155],{"categoryNo":97,"categoryName":98,"taxonomyType":21,"taxonomyTypeDesc":22},[157,158,159,160,29,37,161,162,163],"using superpowers","superpowers","conversation","how to","how","find","questions",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":44},"01M70JN57CE588NPYPYTWH1DWG","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fusing-git-worktrees\u002FSKILL.md",[],[171,172,173,174,175,176,37,108,177,178,179,180,181,182,183,122,29,184,185],"using git worktrees","Using git","git","worktrees","git worktrees","implementation","git worktree","worktree","native","Tools","isolation","fallback","feature","via","workspace"]