container-local-dev
Installation
SKILL.md
Instructions
When to Use
- Use for Dockerfile + Compose for Next on Node LTS.
- Prefer
monorepo-toolingfor workspace package graphs first. - Prefer
env-config-agentfor compose secret naming.
Add Docker and Compose for local and CI-like runs of Next.js (Node 20/22 LTS, pnpm).
.dockerignore: exclude.git,node_modules,.next,dist,.env*(use build args or runtime mount for secrets in dev only).- Multi-stage:
deps(pnpm fetch/install) →builder(pnpm build) →runner(minimal:node_modulesprod slice +.next/standaloneif user enabled standalone output - match theirnext.config). - User: non-root
USER nodeor numeric uid in final stage. - Compose:
app+postgres+ optionalredis; healthchecks; named volumes; no secrets in compose YAML -.envlocal only gitignored. - Dev vs prod:
docker compose -f compose.yaml -f compose.override.yamlpattern for hot reload optional - keep prod Dockerfile lean. - CI: same Dockerfile build in GitHub Actions to prove reproducibility - link
github-actions-ci.
Outcomes
- File list + Dockerfile stage names + compose service graph (bullets).