---
name: "ocf_heartbeat_docker-compose"
section: "7"
platform: "linux"
package: "resource-agents"
version: "1:4.16.0-3+deb13u2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ocf_heartbeat_docker-compose"
---

# ocf\_heartbeat\_docker-compose(7)

This script manages docker services using docker-compose.

## NAME

ocf\_heartbeat\_docker-compose - This script manages docker services using docker-compose.

## SYNOPSIS

**docker-compose** \[start \| stop \| monitor \| meta-data \| validate-all\]

## DESCRIPTION

Manages docker services using docker-compose as an OCF resource in an High Availability setup. It relies on a well-tested docker compose YAML file which distributed on an identical location on all cluster nodes.

Caveat: 1. A YAML file (docker-compose.yml) and an optional Dockerfile must be provided in a working directory. 2. It is suggested to test run the docker-compose and verify on all cluster nodes before enabling this agent.

## SUPPORTED PARAMETERS

**binpath**

The docker-composer binary path. For example, "/usr/bin/docker-compose"

(optional, string, default "/usr/bin/docker-compose")

**dirpath**

The directory contains docker compose yaml file. For example, "/data/docker"

(required, string, no default)

**ymlfile**

The docker-compose yaml file. For example, "docker-compose.yml"

(optional, string, default "docker-compose.yml")

## SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

**start**

Starts the resource. Suggested minimum timeout: 240s.

**stop**

Stops the resource. Suggested minimum timeout: 20s.

**monitor**

Performs a detailed status check. Suggested minimum timeout: 10s. Suggested interval: 60s.

**validate-all**

Performs a validation of the resource configuration. Suggested minimum timeout: 5s.

**meta-data**

Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.

## EXAMPLE CRM SHELL

The following is an example configuration for a docker-compose resource using the [**crm**(8)](/crm/8.md) shell:

```
primitive p_docker-compose ocf:heartbeat:docker-compose \
  params \
    dirpath=string \
  op monitor depth="0" timeout="10s" interval="60s"
```

## EXAMPLE PCS

The following is an example configuration for a docker-compose resource using [**pcs**(8)](/pcs/8.md)

```
pcs resource create p_docker-compose ocf:heartbeat:docker-compose \
  dirpath=string \
  op monitor OCF_CHECK_LEVEL="0" timeout="10s" interval="60s"
```

## SEE ALSO

**http://clusterlabs.org/**

## AUTHOR

**ClusterLabs contributors (see the resource agent source for information about individual authors)**
