# Docker Compose

### Overview

Gathering logs from docker-compose scripts is easy to do and all it takes is for your to configure the fluentd driver to push data to Apica Ascent

Lets look at a simple compose file with a single service *"web"*

```yaml
version: '3.7'
services:
  web:
    image: wordpress
    ports:
      - "89:8080"
    logging:
      driver: "fluentd"
      options:
        fluentd-address: 192.168.68.114:24224
        labels: "namespace,application,production_status,cluster_id"
        env: "os"
    labels:
      production_status: "testing"
      namespace: "us-east-1"
      application: "wordpress"
      cluster_id: "cluster1"
    environment:
      - os=ubuntu
```

### Specifying the logging driver

The *fluentd* logging driver can be configured to send logs directly to Apica Ascent either via TLS or non-TLS. use port *24224* for non-TLS and port *24225* for TLS.

```yaml
logging:
  driver: "fluentd"
  options:
    fluentd-address: 192.168.68.114:24224
    labels: "namespace,application,production_status,cluster_id"
    env: "os"
```

### Adding metadata

Logs get organized in Apica Ascent as flows. A Flow is a combination of a *Namespace* and an *application*. You can optionally also add a third grouping attribute *cluster\_id*.

Aside from this, the labels and environment section allows additional metadata to be sent with logs and can be used for search indexing, aggregate queries

```yaml
labels:
  production_status: "testing"
  namespace: "us-east-1"
  application: "wordpress"
  cluster_id: "cluster1"
environment:
  - os=ubuntu
```

<figure><img src="/files/hSzQ96FqDk4HQZYypnbe" alt=""><figcaption><p>Cluster ID, Namespace, Application mapping</p></figcaption></figure>

<figure><img src="/files/Hmo10Xp1AXKBwDQTXCL3" alt=""><figcaption><p>Additional Metadata</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.apica.io/integrations/list-of-integrations/docker-compose.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
