Docker Compose

Compose develop.watch

Optional development rules for locally built services. Basic Watch requires Compose 2.22.0 or later. sync transfers changed files to a writable target; rebuild constructs and adopts a new image. Check exact action support and stat, mkdir, rmdir availability. Restrict paths to approved source. Wait for the watcher to be active before editing; verify event, content and same worker identity for sync-only rules.

Formal Syntax & Structure

docker syntaxdocker
services.SERVICE.develop.watch

Parameters & Attributes

NameTypeDescription
actionstringSupported update action
pathstringLocal source path
targetstringContainer destination for sync

Working Example

Example Snippetdocker
develop:  watch:    - action: sync      path: ./src      target: /app
Docker Reference