-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] watch watch's root even if that is not specified #11182
Closed
Labels
Comments
Hello @khalil-omer |
I can reproduce this issue, investigating... |
got it: the root cause is your yaml declaration: services:
servicea:
container_name: 'serviceA'
build: ./apps/servicea
develop:
watch:
- action: rebuild
- path: ./apps/serviceA
```�
this ones actually defines 2 watch rules, the first one with an action and no path (defaults to `.`), the second one with a path but no action.
should be:
```yaml
services:
servicea:
container_name: 'serviceA'
build: ./apps/servicea
develop:
watch:
- action: rebuild
path: ./apps/serviceA
```�
Anyway, watch should warn you about no action being configured, and imho `path` should be required. |
Re-opening as we should release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When running a compose file like the below with
docker compose watch
in the context of a monorepo, the directory compose is run from is watched as well as the specific subdirectory. The expected behavior is for the path to be honored.In fact, the output of the watch command includes
watching [/Users/khalil_work/repos/repoName /Users/khalil_work/repos/repoName/apps/serviceA]
which shows that the root is indeed being watched. I would expect only
.apps/serviceA
to be watched, not the root. Root defeats the purpose because then all containers with a watch config will be rebuilt based on any change in the repository.The behavior is the same even if running
docker compose watch servicea
.Compose Version
Docker Environment
The text was updated successfully, but these errors were encountered: