Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions content/manuals/compose/how-tos/file-watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{< include "compose/watch.md" >}}

`watch` adheres to the following file path rules:
* All paths are relative to the project directory
* All paths are relative to the project directory, apart from ignore file patterns
* Directories are watched recursively
* Glob patterns aren't supported
* Rules from `.dockerignore` apply
Expand Down Expand Up @@ -114,14 +114,19 @@
* `target: /app/static` -> `/app/static/index.html`
* `target: /assets` -> `/assets/index.html`

### `ignore`

The `ignore` patterns are relative to the `path` defined in the current `watch` action, not to the project directory. In the following Example 1, the ignore path would be relative to the `./web` directory specified in the `path` attribute.

Check failure on line 119 in content/manuals/compose/how-tos/file-watch.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.Spacing] ' ' should have one space. Raw Output: {"message": "[Docker.Spacing] ' ' should have one space.", "location": {"path": "content/manuals/compose/how-tos/file-watch.md", "range": {"start": {"line": 119, "column": 143}}}, "severity": "ERROR"}

## Example 1

This minimal example targets a Node.js application with the following structure:
```text
myproject/
├── web/
│ ├── App.jsx
│ └── index.js
│ ├── index.js
│ └── node_modules/
├── Dockerfile
├── compose.yaml
└── package.json
Expand Down Expand Up @@ -152,6 +157,8 @@

Once copied, the bundler updates the running application without a restart.

And in this case, the `ignore` rule would apply to `myproject/web/node_modules/`, not `myproject/node_modules/`.

Unlike source code files, adding a new dependency can’t be done on-the-fly, so whenever `package.json` is changed, Compose
rebuilds the image and recreates the `web` service container.

Expand Down