prod-swarm-deploy

Build, push, and deploy Docker images to a production Docker Swarm with schema migrations and smoke tests.

Updated May 11, 2026
One-click install
npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill prod-swarm-deploy-thachrocky12345
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prod-swarm-deploy
Source: https://github.com/thachrocky12345/local-agent-train-workstation/tree/main/.claude/skills/prod-swarm-deploy
Command: npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill prod-swarm-deploy-thachrocky12345

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deploying a pnpm monorepo app to a two-node Docker Swarm involves many failure-prone steps: versioned image tagging, build-time env vars for Next.js, gated Prisma schema pushes, and post-deploy verification. This Skill codifies the exact commands, ordering, and failure triage so deploys don't silently ship stale images or broken endpoints. ## Core Features & Use Cases - Versioned build and push: Builds API and web Docker images with bumped tags and pushes them to Docker Hub, avoiding stale digest caching on swarm workers. - Stack deploy and schema migration: Updates docker-stack.yml image tags, deploys with registry auth, and applies Prisma schema changes through a gated DB_AUTO_PUSH entrypoint flag. - Smoke tests and failure triage: Verifies health endpoints and auth round-trips after deploy, with a symptom-to-fix table covering proxy errors, missing relations, EACCES paths, and port conflicts. - Use Case: After merging a feature, ask to redeploy the API — the Skill type-checks, builds and pushes a new tag, updates the stack, waits for convergence, and smoke-tests the endpoints. ## Quick Start Deploy the latest API and web builds to the production swarm and run the smoke tests to confirm everything is healthy.

Frequently Asked Questions about prod-swarm-deploy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a Docker Swarm stack with updated image tags?

Build and push images with a new version tag, update the tags in docker-stack.yml with sed, then run docker stack deploy with --with-registry-auth so swarm nodes can pull from Docker Hub. Wait for convergence by polling docker stack ps until no tasks remain in Starting or Pending states.

How do I apply Prisma schema changes to a production database safely?

Use a gated entrypoint flag instead of running prisma db push directly: set DB_AUTO_PUSH=true on the service with docker service update, confirm the push in logs, then flip it back to false. This avoids permission-blocked --accept-data-loss commands against production.

Why does my Next.js app show 'Internal Server Error' as invalid JSON after deploy?

This usually means the API returned a 500 or the Next.js proxy cannot reach the API. Check API logs first; if it is a proxy issue, INTERNAL_API_URL was not baked at build time, so rebuild the web image with --build-arg INTERNAL_API_URL set to the API host.

Why does Docker Swarm keep serving a stale image after I push?

Swarm workers cache image digests, so pushing to the same tag may not trigger a real pull. Always bump the version tag on every push and update the stack file to reference the new tag before redeploying.

Why is a Docker Swarm service stuck Pending with host-mode ports?

The default start-first update order conflicts with mode: host ports because the new task cannot bind a port the old task still holds. Use stop-first ordering, or force it with docker service update --update-order stop-first --force on the service.