docker_compose
Collection: community.general
Full Name: parallax.community.general.docker_compose
Aliases: community.general.docker_compose, docker_compose
Synopsis
Manage docker compose
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| project_src | string | yes | Path to the directory containing docker-compose files | |
| state | string | present | State of the services Choices: present, absent | |
| services | string | Comma-separated list of specific services to operate on | ||
| files | string | Comma-separated list of compose files to use | ||
| build | bool | false | Build images before starting containers | |
| pull | bool | false | Pull images before starting containers | |
| recreate | string | smart | Recreate strategy Choices: smart, always, never | |
| remove_images | string | Remove images when state=absent Choices: all, local | ||
| remove_orphans | bool | false | Remove containers for services not defined in compose file | |
| remove_volumes | bool | false | Remove volumes when state=absent | |
| stopped | bool | false | Leave containers in stopped state | |
| timeout | int | 10 | Timeout in seconds for container shutdown | |
| nocache | bool | false | Do not use cache when building images | |
| scale | string | Scale service to specified number of instances (service=num) | ||
| env_file | string | Path to an env file for docker-compose | ||
| definition | string | Inline compose definition (YAML string) | ||
| project_name | string | Project name for compose |
Example
- name: Example docker_compose task
docker_compose:
project_src: <your_project_src>