avast/gradle-docker-compose-plugin

Recreate the container if a volume file changed

オープン

#444 opened on 2024/06/25

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Groovy (103 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (429 個のスター)
PR merge metrics
 (平均マージ 24d 11h) (30d で 2 merged PRs)

説明

I have a Docker Compose service that mounts some project files as volume into the container

services:
  my-service:
    …
    volumes:
      - ./my-config1.yaml:/path/in/container/my-config1.yaml:ro
      - ./my-config2.yaml:/path/in/container/my-config2.yaml:ro

To the best of my knowledge, docker compose up my-service does not restart the container if it’s already up and running, even if my-config1.yaml or my-config2.yaml changed.

Since we are using Gradle with the gradle-docker-compose-plugin anyway, I would like to leverage Gradle to track input file changes and let trigger the Docker container recreation if necessary.

Is there a recommended way to achieve this or does even gradle-docker-compose-plugin support this feature out-of-the-box?

コントリビューターガイド