Skip to content

Commit a9b3fe9

Browse files
authored
Merge pull request #22271 from aevesdocker/watch.include
watch include
1 parent a64ea4d commit a9b3fe9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

content/reference/compose-file/develop.md

+19
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,25 @@ The syntax is the same as `.dockerignore` file:
102102
If the build context includes a `.dockerignore` file, the patterns in this file is loaded as implicit content
103103
for the `ignores` file, and values set in the Compose model are appended.
104104

105+
#### `include`
106+
107+
It is sometimes easier to select files to be watched instead of declaring those that shouldn't be watched with `ignore`.
108+
109+
The `include` attribute can be used to define a pattern, or a list of patterns, for paths to be considered for watching.
110+
Only files that match these patterns will be considered when applying a watch rule. The syntax is the same as `ignore`.
111+
112+
```yaml
113+
services:
114+
backend:
115+
image: example/backend
116+
develop:
117+
watch:
118+
# rebuild image and recreate service
119+
- path: ./src
120+
include: *.go
121+
action: rebuild
122+
```
123+
105124
#### `path`
106125

107126
`path` attribute defines the path to source code (relative to the project directory) to monitor for changes. Updates to any file

0 commit comments

Comments
 (0)