Docker
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 | 7 |
Lexicon version: 0.59.0
Namespace: Docker
- Intrinsic Functions — 1 built-in functions
- All Rules — 7 rules
- Serialization — output format details