Getting Started
Installation
Section titled “Installation”# New projectchant init --lexicon docker my-projectcd my-project
# Existing projectnpm install --save-dev @intentius/chant-lexicon-dockerYour first Compose stack
Section titled “Your first Compose stack”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"],});Build and run
Section titled “Build and run”# Generate docker-compose.ymlchant build src --lexicon docker -o docker-compose.yml
# Lint for issues before runningchant lint src
# Bring up the stackdocker compose up -dNext steps
Section titled “Next steps”- Compose Resources — Service, Volume, Network, Config, Secret
- Dockerfiles — multi-stage build definitions
- Examples — real-world patterns
- Lint Rules — what
chant lintchecks