You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docker/docker-compose.md
+13
Original file line number
Diff line number
Diff line change
@@ -67,3 +67,16 @@ services:
67
67
depends_on:
68
68
- database
69
69
```
70
+
71
+
## 2. Use Compose watch
72
+
73
+
> Compose >= 2.22
74
+
75
+
- Use `watch` to automatically update and preview your running Compose services as you edit and save your code.
76
+
- Use case: automatic updates.
77
+
- The `watch` attribute defines a list of rules that control automatic service updates based on local file changes.
78
+
- `path`pattern.
79
+
- `action`to take when a modification is detected.
80
+
- `sync`: compose makes sure any changes made to files on your host automatically match with the corresponding files within the service container -> **hot reload**.
81
+
- `rebuild`: compose automatically builds a new image with BuildKit and replaces the running service container -> compiled languages or as fallbacks for modifications to particular files that require a full image rebuild (e.g. `package.json`).
82
+
- `sync+restart`: composes synchronizes your changes with the services containers and restarts it.
0 commit comments