Docker
llms.txt lists every page for an agent
Show the whole prompt
Read https://intentius.io/chant/lexicons/docker/ and https://intentius.io/chant/lexicons/docker/dockerfiles/ first.
Bring this project's Docker files into chant TypeScript under src/.
Import each existing file. `-o` names a directory, and each import writes main.ts in it: `chant import --lexicon docker docker-compose.yml -o src/compose/`, and `chant import --lexicon docker Dockerfile -o src/<name>/` for each Dockerfile.
An imported Dockerfile is exported as `app`. Rename each export after its image, since the export name sets the output file (Dockerfile.<export>), and point the Compose service's `build.dockerfile` at that export (`dockerfile: webImage`) instead of the old file name.
Write every Dockerfile stage as an ordered `steps` list, one instruction per step, with FROM as the stage's `from` and ARGs before the first FROM in `globalArgs`:
steps: [{ workdir: "/app" }, { copy: "package*.json ./" }, { run: "npm ci" }, { copy: ". ." }, { user: "node" }, { cmd: ["node", "dist/index.js"] }]
Where two Dockerfiles repeat a stage or a run of steps, export it once as a const (a `DockerfileStage` or a `DockerfileStep[]`) from its own module and import it in both. Spread imported consts, not function results; a Dockerfile that needs parameters is a `Composite`.
Run `chant build src --lexicon docker -o build/docker-compose.yml` (Dockerfiles are written beside it) and compare with the original files, then `chant lint src`. Run `chant lint src --fix` for DKRS002 (per-kind fields to `steps`, then reorder the steps it writes), fix every other finding by hand, and repeat until lint is clean.
Report the generated docker-compose.yml and each Dockerfile.<name>, and any finding you left and why.
Do not push an image, run `docker compose up` against anything but the local Docker daemon, or change files outside this project.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.Optional: hand this page to your coding agent
Read https://intentius.io/chant/lexicons/docker/ and https://intentius.io/chant/lexicons/docker/dockerfiles/ first.Bring this project's Docker files into chant TypeScript under src/.Import each existing file. `-o` names a directory, and each import writes main.ts in it: `chant import --lexicon docker docker-compose.yml -o src/compose/`, and `chant import --lexicon docker Dockerfile -o src/<name>/` for each Dockerfile.An imported Dockerfile is exported as `app`. Rename each export after its image, since the export name sets the output file (Dockerfile.<export>), and point the Compose service's `build.dockerfile` at that export (`dockerfile: webImage`) instead of the old file name.Write every Dockerfile stage as an ordered `steps` list, one instruction per step, with FROM as the stage's `from` and ARGs before the first FROM in `globalArgs`: steps: [{ workdir: "/app" }, { copy: "package*.json ./" }, { run: "npm ci" }, { copy: ". ." }, { user: "node" }, { cmd: ["node", "dist/index.js"] }]Where two Dockerfiles repeat a stage or a run of steps, export it once as a const (a `DockerfileStage` or a `DockerfileStep[]`) from its own module and import it in both. Spread imported consts, not function results; a Dockerfile that needs parameters is a `Composite`.Run `chant build src --lexicon docker -o build/docker-compose.yml` (Dockerfiles are written beside it) and compare with the original files, then `chant lint src`. Run `chant lint src --fix` for DKRS002 (per-kind fields to `steps`, then reorder the steps it writes), fix every other finding by hand, and repeat until lint is clean.Report the generated docker-compose.yml and each Dockerfile.<name>, and any finding you left and why.Do not push an image, run `docker compose up` against anything but the local Docker daemon, or change files outside this project.Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.The Docker lexicon provides typed constructors for Docker Compose services and Dockerfile build instructions — services, volumes, networks, configs, secrets, and multi-stage Dockerfiles.
npm install --save-dev @intentius/chant-lexicon-dockerQuick Start
Section titled “Quick Start”import { Service, Volume, Dockerfile, env } from "@intentius/chant-lexicon-docker";
export const db = new Service({ image: "postgres:16-alpine", environment: { POSTGRES_DB: "myapp", POSTGRES_PASSWORD: env("DB_PASSWORD", { required: true }), }, volumes: ["pgdata:/var/lib/postgresql/data"],});
export const pgdata = new Volume({});
export const api = new Service({ image: "myapp:1.0", ports: ["8080:8080"], depends_on: ["db"],});Build:
chant build src --lexicon docker -o docker-compose.ymlOutput Domains
Section titled “Output Domains”| Entity | Output file | Section |
|---|---|---|
Service | docker-compose.yml | services: |
Volume | docker-compose.yml | volumes: |
Network | docker-compose.yml | networks: |
Config | docker-compose.yml | configs: |
Secret | docker-compose.yml | secrets: |
Dockerfile | Dockerfile.{name} | — |
At a Glance
Section titled “At a Glance”| Metric | Count |
|---|---|
| Resources | 6 |
| Property types | 0 |
| Services | 2 |
| Intrinsic functions | 1 |
| Pseudo-parameters | 0 |
| Lint rules | 16 |
Lexicon version: 0.124.34
Namespace: Docker
- Intrinsic Functions — 1 built-in functions
- All Rules — 16 rules
- Serialization — output format details