Encode a docker-compose configuration as a JSON string.
Parameters mirror the top-level keys of the
Compose Specification.
The returned string is suitable for passing to the config attribute
of docker_compose_yaml.
PARAMETERS
Name
Description
Default Value
services
A dict mapping service names to their configuration dicts. Each value follows the Compose services.<name> schema (image, ports, environment, volumes, depends_on, etc.).
{}
networks
A dict mapping network names to their configuration dicts. Follows the Compose networks.<name> schema.
{}
volumes
A dict mapping volume names to their configuration dicts. Follows the Compose volumes.<name> schema.
{}
configs
A dict mapping config names to their configuration dicts. Follows the Compose configs.<name> schema.
{}
secrets
A dict mapping secret names to their configuration dicts. Follows the Compose secrets.<name> schema.
{}
RETURNS
A JSON-encoded string representing the docker-compose configuration.