docker_compose

Collection: community.general

Full Name: parallax.community.general.docker_compose

Aliases: community.general.docker_compose, docker_compose

Synopsis

Manage docker compose

Parameters

NameTypeRequiredDefaultDescription
project_srcstringyesPath to the directory containing docker-compose files
statestringpresentState of the services Choices: present, absent
servicesstringComma-separated list of specific services to operate on
filesstringComma-separated list of compose files to use
buildboolfalseBuild images before starting containers
pullboolfalsePull images before starting containers
recreatestringsmartRecreate strategy Choices: smart, always, never
remove_imagesstringRemove images when state=absent Choices: all, local
remove_orphansboolfalseRemove containers for services not defined in compose file
remove_volumesboolfalseRemove volumes when state=absent
stoppedboolfalseLeave containers in stopped state
timeoutint10Timeout in seconds for container shutdown
nocacheboolfalseDo not use cache when building images
scalestringScale service to specified number of instances (service=num)
env_filestringPath to an env file for docker-compose
definitionstringInline compose definition (YAML string)
project_namestringProject name for compose

Example

- name: Example docker_compose task
  docker_compose:
    project_src: <your_project_src>