Skip to content

Getting Started

llms.txt lists every page for an agent
Optional: hand this page to your coding agentThe steps work by hand too.
Show the whole prompt
Read https://intentius.io/chant/lexicons/docker/getting-started/.
In a new directory, run `npx chant init --lexicon docker my-project`, write the Compose stack from the page in `src/compose.ts`, and run `npx chant build src --lexicon docker -o docker-compose.yml` and `npx chant lint src`.
Bring it up on the local Docker daemon with `docker compose up -d`, show me the output of `docker compose ps`, then run `docker compose down`.
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`.
Terminal window
# New project
chant init --lexicon docker my-project
cd my-project
# Existing project
npm install --save-dev @intentius/chant-lexicon-docker

Create src/compose.ts:

import { Service, Volume, env } from "@intentius/chant-lexicon-docker";
export const db = new Service({
image: "postgres:16-alpine",
environment: {
POSTGRES_DB: "myapp",
POSTGRES_USER: "myapp",
POSTGRES_PASSWORD: env("DB_PASSWORD", { required: true }),
},
volumes: ["pgdata:/var/lib/postgresql/data"],
restart: "unless-stopped",
});
export const pgdata = new Volume({});
export const api = new Service({
image: "myapp:1.0",
ports: ["8080:8080"],
depends_on: ["db"],
});
Terminal window
# Generate docker-compose.yml
chant build src --lexicon docker -o docker-compose.yml
# Lint for issues before running
chant lint src
# Bring up the stack
docker compose up -d

chant