dockerize-and-deploy
Installation
SKILL.md
Dockerize and Deploy
Containerize a repo and produce a deployment setup, one phase at a time.
Workflow
1. Audit
Identify runtime, services, datastores, build step, existing Docker files, and env vars. Propose phases before writing.
2. Phases
- Dockerfile — multi-stage: builder installs/compiles, runtime copies artifacts only, non-root user, pinned base image (e.g.
node:20.11-alpine),.dockerignoreexcludesnode_modules/.env/.git. - docker-compose — dev stack: source mounts for hot reload, debug ports, named volumes.
- Production compose (
docker-compose.prod.yml) — no source mounts,restart: unless-stopped, healthchecks, explicit volumes,mem_limit/cpuslimits. See REFERENCE.md. - Pre-flight — copy
scripts/preflight.shinto the project; validates env vars, Docker, port conflicts, DB reachability, dry-run build. Run:bash scripts/preflight.sh. - Deploy —
scripts/deploy.sh: runpreflight.sh(abort on fail) → pull/build image → run migrations → rolling restart → health-check → print status.
Merge or skip phases for simple repos.