{
  "schema": "leumas.docs.page/1",
  "id": "adapter:domain/dockerfile",
  "slug": "adapters/domain/dockerfile",
  "kind": "capabilities",
  "bucket": "package",
  "title": "dockerfile — container image intelligence pack",
  "name": "dockerfile",
  "eyebrow": "container image intelligence pack",
  "chip": null,
  "summary": "Dockerfile & container image intelligence pack: generate a production-ready Dockerfile from a {stack,port} spec (node, python, go, rust, java, php, static/nginx, ruby, deno, bun), lint an existing...",
  "keywords": [
    "dockerfile",
    "production-ready",
    "nginx",
    "deno",
    "cache-busting",
    "latest-tag",
    "multistage",
    "language-aware"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# dockerfile — container image intelligence pack\n\nGenerate, lint, and optimize Dockerfiles from a curated best-practice rule engine + heuristic\ntemplates. Pure ESM, Node built-ins only, zero npm deps. Every tool has a deterministic core that\nworks fully offline; generate/lint optionally enrich via an LLM (`options.ai`) and always fall back.\n\n## Tools\n\n| Tool | Input | Output |\n|---|---|---|\n| `generate` | `{ stack, port?, version?, options? }` | A production-ready single-stage Dockerfile (cache-friendly layer order, non-root USER, EXPOSE, HEALTHCHECK, CMD). |\n| `lint` | `{ dockerfile }` | ~13 best-practice rules (latest tag, root user, apt cache, cache-busting COPY, baked secrets, missing HEALTHCHECK…) → severities, fixes, a score/grade. |\n| `optimize` | `{ dockerfile }` | Detects the stack, flags single-stage builds that should be multi-stage, suggests slimmer bases / fewer layers, and emits a multi-stage skeleton. |\n| `multiStage` | `{ stack, port?, version?, options? }` | A builder + runtime multi-stage Dockerfile that ships only the built artifact. |\n| `dockerignore` | `{ stack }` | A language-aware `.dockerignore`. |\n| `healthcheck` | `{ stack?, port?, options? }` | A `HEALTHCHECK` instruction block for the given port/path. |\n\nSupported stacks: `node, python, go, rust, java, php, ruby, deno, bun, static/nginx` (plus aliases\nlike `js`, `py`, `golang`, `react`, `rails`, `spring`).\n\n## Usage\n\n```js\nimport pack from './index.js';\nconst { dockerfile } = await pack.adapters.generate({ stack: 'node', port: 8080 });\nconst report = await pack.adapters.lint({ dockerfile: 'FROM node\\nCOPY . .\\nRUN npm install' });\n// report.findings -> [{ id:'latest-tag', severity:'high', ... }, ...]\n```\n\n## AI mode\n\nSet `options.ai: true`. When a model is reachable (via `../_shared/llm.js`) `generate` rewrites the\nDockerfile and `lint` adds a remediation `summary`; results are tagged `mode: 'llm'`. With no model\nyou get the deterministic template/rules, tagged `mode: 'heuristic'`. A down model never throws.\n\n## DRY boundary\n\nDocker/container tooling over Dockerfile TEXT and `{stack,port}` specs. It does **not** run docker,\nbuild images, parse `package.json` (see `dependency-auditor`), or lint application source\n(`code-metrics`). Signing/verifying webhooks lives in `webhook-forge`.\n",
  "source": {
    "path": "shared/engines/adapters/domain/dockerfile/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 2504,
    "hash": "b3931af987890b118d1e8a5635f852eae56199c6"
  },
  "urls": {
    "html": "/p/adapters/domain/dockerfile",
    "json": "/docs/adapters/domain/dockerfile.json",
    "md": "/docs/adapters/domain/dockerfile.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
