# Native Docker Compose

The *auterion-app.yml* file defines the configuration your app and all the API configurations.\
While most things can be achieved with officially specified APIs, in some cases deeper system access is necessary. For this case, we offer the compose override API.

## App installation process

<figure><img src="https://3329189600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFW1Ge1p1f6WHyiYCb146%2Fuploads%2Fgit-blob-5a7737c1d788da1b89d27250340cc07912db39a4%2Fcompose-override.drawio.svg?alt=media&#x26;token=1413ac95-9278-40ae-be33-44caf04db402" alt=""><figcaption><p>Schematic app build and installation process</p></figcaption></figure>

An AuterionOS app is a collection of docker containers, in general spawned by docker compose. The docker compose file is automatically created from the *auterion-app.yml* during installation of the app on the Skynode.

## Customizing the docker-compose

In general, there should be no need to customize the generated docker-compose file. However, for certain use-cases, it might be necessary. In order to do that, you can add the following part to your auterion-app.yml file:

{% code title="auterion-app.yml" %}

```yaml
compose-override:
    services:
        my-service:
            # any docker-compose syntax is valid here
```

{% endcode %}

At the moment, all docker-compose properties are supported.

{% hint style="warning" %}
**Some raw docker-compose overrides may become unavailable** in future API versions, as we evolve the platform.
{% endhint %}

### Example

For example, you may have the need to access a certain device from `/dev` on the host in your app, as well as elevate your apps privileges to talk to that device. You could achieve that with:

{% code title="auterion-app.yml" %}

```yaml
compose-override:
    services:
        my-service:
            devices:
                - /dev/my-device:/dev/my-device
            device_cgroup_rules:
                - 'c 188:* rmw'
```

{% endcode %}

### Default properties

Without specifying any *compose-override* properties in you *auterion-app.yml* file, your app will be configured with a set of default properties. Some of these defaults are:

```yaml
  container_name: <app-name>.<my-service>
  image: <app-name>.<my-service>:<app-version>
  restart: unless-stopped
  extra_hosts:
    - auterion-host:host-gateway
  environment:
    - PYTHONUNBUFFERED=1
  volumes:
    - /data/app/app-name/data:/data
  env_file:
    - settings.default.env
    - settings.user.env
```

The behavior when providing *compose-override* properties is dependant on the version of *app-configurator* that you have installed on your device.

Starting with AuterionOS v3.5.3, user-specified properties will **extend** the values of that property if it can hold multiple values (e.g., volumes); single-value properties will be overwritten. For AuterionOS versions strictly older than v3.5.3, any user-specified property will **overwrite all entries** for that property, requiring you to repeat the default value if still needed.
