# Deploy Docker Compose

JFrog Connect enables you to deploy multiple containers by using [Docker Compose](https://docs.docker.com/compose/) capabilities. When you choose Deploy Docker Compose as step type in your update flow, JFrog Connect will upload the corresponding YAML file to Artifactory, and the edge device will pull it during the update.

Connect agent utilizes Docker and the Docker Compose engine to pull and run the image containers to the edge. Therefore, Docker standard practices are applied when pulling images (e.g., Docker cache and image layers).

## Prerequisites

* JFrog Platform Account.&#x20;
* Connect Agent 6.0 or later on device(s).
* Docker and Docker Compose installed on your device(s).
* A Docker Compose configuration file located in Artifactory.
* One or more Docker images in the JFrog Platform ready for deployment. If you need to push an image to the JFrog Platform, use the `docker tag` and `docker push` commands as shown below.

<div align="left"><figure><img src="https://content.gitbook.com/content/OX8HIrQ8f257lv49Od1Z/blobs/U1wIlWleyvZ26sfY2yJp/deploy-containers-00.png" alt="" width="536"><figcaption></figcaption></figure></div>

* In the [Create Update Flow](https://app.gitbook.com/o/-MKoacyWO_IyId6sEp-u/s/MJq8oZy7Sjg5aIiKLxrw/deployment/update-flow) procedure, completed through Step 3.

## Docker Compose Version on Device

On the device, Connect Agent checks which version of Docker Compose is present and acts according to the following logic:

* If docker-compose v1 is present, then Connect Agent uses docker-compose v1.
* If docker-compose v1 is *not* present, then it uses Docker Compose v2 (no hyphen).

Therefore, if both Docker Compose v1 and v2 are present, then Connect Agent will use v1.

## Add a Step and Configure the Step Type <a href="#add-a-step-and-configure-the-step-type" id="add-a-step-and-configure-the-step-type"></a>

To add a step and configure the step type you have chosen, do the following:

1. In the Create New Flow page, click **Add Step**.
2. In the **Step Type** dropdown list, choose **Deploy Docker Compose**, give the step a **Step** **Name**, and create the step. You can change the step name afterwards if you need to.
3. **JFrog Registry:** Choose the JFrog Registry where your artifact is stored. If the registry does not appear in the list, go to [Add JFrog Registry](https://docs.connect.jfrog.io/administration-new-ui/general-settings/registry/add-jfrog-registry) to add yours to the list. Then return to this configuration and the added registry will appear in the list.

{% hint style="success" %}
**Tips**:&#x20;

* When your Docker Compose YAML points to multiple Docker images, the images must be in the same registry.
* If you want the step to pull content from an Artifactory Edge account, complete the procedure in [Add JFrog Registry](https://docs.connect.jfrog.io/administration-new-ui/general-settings/registry/add-jfrog-registry), and then choose that registry as your JFrog Registry.
  {% endhint %}

<div align="left"><figure><img src="https://1679291640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOX8HIrQ8f257lv49Od1Z%2Fuploads%2FWD0FtswHNcztNkLMfPSi%2Fdeploy-docker-compose-nui-02.png?alt=media&#x26;token=2f062f0c-b608-4237-8833-f11cc3cf0dd2" alt="" width="563"><figcaption></figcaption></figure></div>

4. Enter the source of your Docker Compose YAML file, which may be one of the following, depending on the registry you chose.

**JFrog Artifactory Path (YAML file)**: This is the unique path where the Docker YAML file is located in Artifactory and the YAML file name. Enter this if you chose **default-connect** for the registry or any other Artifactory registry.

{% hint style="success" %}
**Tips**: If you need help finding the Artifactory Path in Artifactory, see [Get Artifactory Path.](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/step-types/download-artifacts/get-artifactory-path)
{% endhint %}

**Docker Compose YAML File**: If you chose a **Docker** registry for the registry, drag and drop or browse to enter the Docker Compose YAML file. When you drag and drop, the file is uploaded to “Connect Default Generic” in Artifactory.

<div align="left"><figure><img src="https://content.gitbook.com/content/OX8HIrQ8f257lv49Od1Z/blobs/AXFumjV8Nm1ZyBQLb0gK/deploy-docker-compose-nui-02.png" alt="" width="563"><figcaption></figcaption></figure></div>

5. **Device Path**: Enter the path where the Docker Compose YAML file should be placed on the device. The folder must already exist on this path or the update will fail. (You can create a folder using the Run Command step type.)

## On Failure (Optional)

1. Configure your [On Failure](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/on-failure-and-rollback) policy and instructions for rolling back.&#x20;
2. Save your step configuration.

## What’s Next?

Learn how to take the next step and run the [update deployment](https://docs.connect.jfrog.io/features-new-ui/deployments/update-deployment).
