ConfigurationTriggersDocker Compose
Docker-Compose
The dockercompose trigger lets you update docker-compose.yml files & replace existing containers with their updated versions.

The dockercompose trigger lets you update docker-compose.yml files & replace existing containers with their updated versions.
The trigger will:
- Update the related docker-compose.yml file
- Clone the existing container specification
- Pull the new image
- Stop the existing container
- Remove the existing container
- Create the new container
- Start the new container (if the previous one was running)
- Run
post_starthooks declared on the updated service (if any) - Remove the previous image (optionally)
Variables
| Env var | Required | Description | Supported values | Default value when missing |
|---|---|---|---|---|
DD_TRIGGER_DOCKERCOMPOSE_{trigger_name}_FILE | 🔴 | The docker-compose.yml file location | ||
DD_TRIGGER_DOCKERCOMPOSE_{trigger_name}_BACKUP | ⚪ | Backup the docker-compose.yml file as .back before updating? | true, false | false |
DD_TRIGGER_DOCKERCOMPOSE_{trigger_name}_PRUNE | ⚪ | If the old image must be pruned after upgrade | true, false | false |
DD_TRIGGER_DOCKERCOMPOSE_{trigger_name}_DRYRUN | ⚪ | When enabled, only pull the new image ahead of time | true, false | false |
DD_TRIGGER_DOCKERCOMPOSE_{trigger_name}_COMPOSEFILELABEL | ⚪ | Container label name used to locate the compose file per container | Label name | dd.compose.file |
This trigger also supports the common configuration variables. but only supports the
batch mode.This trigger will only work with locally watched containers.
Do not forget to mount the docker-compose.yml file in the drydock container.
Troubleshooting: permission denied (EACCES)
If logs show an error like:
EACCES: permission denied, access '/drydock/.../docker-compose.yml'the mounted compose file (or parent directory) is not readable by the Drydock process.
Ways to fix:
- Grant read access on the mounted path for the user/group used by the Drydock container.
- Add the host group that owns the compose files with
group_addso Drydock can read them. - Quick workaround: set
DD_RUN_AS_ROOT=trueto skip privilege drop (less secure).
Example using group_add:
services:
drydock:
image: codeswhat/drydock
group_add:
- "${COMPOSE_FILES_GID}"
volumes:
- /var/lib/docker/volumes/portainer_data/_data/compose:/drydock:ro
environment:
- DD_TRIGGER_DOCKERCOMPOSE_EXAMPLE_FILE=/drydock/5/docker-compose.ymlCOMPOSE_FILES_GID should match the GID that owns the mounted compose files on the host.Examples
services:
drydock:
image: codeswhat/drydock
...
volumes:
- /etc/my-services/docker-compose.yml:/drydock/docker-compose.yml
environment:
- DD_TRIGGER_DOCKERCOMPOSE_EXAMPLE_FILE=/drydock/docker-compose.ymldocker run \
-v /etc/my-services/docker-compose.yml:/drydock/docker-compose.yml
-e "DD_TRIGGER_DOCKERCOMPOSE_EXAMPLE_FILE=/drydock/docker-compose.yml" \
...
codeswhat/drydocklabels:
dd.compose.file: "/my/path/docker-compose.yaml