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.watchParameters & Attributes
| Name | Type | Description |
|---|---|---|
| action | string | Supported update action |
| path | string | Local source path |
| target | string | Container destination for sync |
Working Example
Example Snippetdocker
develop: watch: - action: sync path: ./src target: /app