Skip to content

API Reference parrot_tools.docker.compose

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.docker.compose

View source

Docker Compose file generator.

Generates valid docker-compose YAML files from Pydantic ComposeServiceDef models. Implements spec Section 3 — Module 4 (FEAT-033).

Class ComposeGenerator

Generates docker-compose YAML from Pydantic models.

Converts ComposeServiceDef instances into valid docker-compose v3.8 YAML, extracts named volumes into the top-level volumes section, and writes to disk at the configured DOCKER_FILE_LOCATION or a user-specified path.

Method ComposeGenerator.to_dict

Convert service definitions to a compose dict.

to_dict(project_name: str, services: Dict[str, ComposeServiceDef]) -> dict

Parameter Type Default Description
project_name str Project name (used for logging/context).
services Dict[str, ComposeServiceDef] Service definitions keyed by service name.

Returns: dict — A dict representing a valid docker-compose v3.8 structure.

Method ComposeGenerator.generate

Generate and write a docker-compose.yml file.

generate(project_name: str, services: Dict[str, ComposeServiceDef], output_path: Optional[str] = None) -> str

Parameter Type Default Description
project_name str Project name for the compose stack.
services Dict[str, ComposeServiceDef] Service definitions keyed by service name.
output_path Optional[str] None Path to write the file. Defaults to DOCKER_FILE_LOCATION / docker-compose.yml.

Returns: str — The absolute path to the written file.

Method ComposeGenerator.validate

Validate a docker-compose file using docker compose config.

validate(compose_path: str) -> bool

Parameter Type Default Description
compose_path str Path to the docker-compose.yml file.

Returns: bool — True if the file is valid, False otherwise.

Alias ComposeServiceDef

Re-exported from parrot_tools.docker.models.ComposeServiceDef.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally