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: content/reference/compose-file/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ aliases:
45
45
46
46
The Compose Specification is the latest and recommended version of the Compose file format. It helps you define a [Compose file](/manuals/compose/intro/compose-application-model.md) which is used to configure your Docker application’s services, networks, volumes, and more.
47
47
48
-
Legacy versions 2.x and 3.x of the Compose file format were merged into the Compose Specification. It is implemented in versions 1.27.0 and above (also known as Compose V2) of the Docker Compose CLI.
48
+
Legacy versions 2.x and 3.x of the Compose file format were merged into the Compose Specification. It is implemented in versions 1.27.0 and above (also known as Compose v2) of the Docker Compose CLI.
49
49
50
50
The Compose Specification on Docker Docs is the Docker Compose implementation. If you wish to implement your own version of the Compose Specification, see the [Compose Specification repository](https://github.com/compose-spec/compose-spec).
Copy file name to clipboardExpand all lines: content/reference/compose-file/build.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ services:
49
49
50
50
When used to build service images from source, the Compose file creates three Docker images:
51
51
52
-
* `example/webapp`: A Docker image is built using `webapp` sub-directory, within the Compose file's parent folder, as the Docker build context. Lack of a `Dockerfile` within this folder throws an error.
52
+
* `example/webapp`: A Docker image is built using `webapp` sub-directory, within the Compose file's parent folder, as the Docker build context. Lack of a `Dockerfile` within this folder returns an error.
53
53
* `example/database`: A Docker image is built using `backend` sub-directory within the Compose file parent folder. `backend.Dockerfile` file is used to define build steps, this file is searched relative to the context path, which means `..` resolves to the Compose file's parent folder, so `backend.Dockerfile` is a sibling file.
54
54
* A Docker image is built using the `custom` directory with the user's `$HOME` as the Docker context. Compose displays a warning about the non-portable path used to build image.
Copy file name to clipboardExpand all lines: content/reference/compose-file/develop.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,8 +43,6 @@ services:
43
43
44
44
## Attributes
45
45
46
-
<!-- vale Docker.HeadingSentenceCase = NO ) -->
47
-
48
46
The `develop` subsection defines configuration options that are applied by Compose to assist you during development of a service with optimized workflows.
49
47
50
48
### `watch`
@@ -90,7 +88,7 @@ services:
90
88
91
89
#### `ignore`
92
90
93
-
The `ignore` attribute can be used to define a list of patterns for paths to be ignored. Any updated file
91
+
The `ignore` attribute is used to define a list of patterns for paths to be ignored. Any updated file
94
92
that matches a pattern, or belongs to a folder that matches a pattern, won't trigger services to be re-created.
95
93
The syntax is the same as `.dockerignore` file:
96
94
@@ -106,7 +104,7 @@ for the `ignores` file, and values set in the Compose model are appended.
106
104
107
105
It is sometimes easier to select files to be watched instead of declaring those that shouldn't be watched with `ignore`.
108
106
109
-
The `include` attribute can be used to define a pattern, or a list of patterns, for paths to be considered for watching.
107
+
The `include` attribute is used to define a pattern, or a list of patterns, for paths to be considered for watching.
110
108
Only files that match these patterns will be considered when applying a watch rule. The syntax is the same as `ignore`.
111
109
112
110
```yaml
@@ -117,10 +115,15 @@ services:
117
115
watch:
118
116
# rebuild image and recreate service
119
117
- path: ./src
120
-
include: *.go
118
+
include: "*.go"
121
119
action: rebuild
122
120
```
123
121
122
+
> [!NOTE]
123
+
>
124
+
> In many cases `include` patterns start with a wildcard (`*`) character. This has special meaning in YAML syntax
125
+
> to define an [alias node](https://yaml.org/spec/1.2.2/#alias-nodes) so you have to wrap pattern expression with quotes.
126
+
124
127
#### `path`
125
128
126
129
`path`attribute defines the path to source code (relative to the project directory) to monitor for changes. Updates to any file
> In the example above, the environment variables are declared using the `FOO: BAR` mapping syntax, while the sequence syntax `- FOO=BAR` is only valid when no fragments are involved.
119
119
120
-
## Informative Historical Notes
120
+
## Informative historical notes
121
121
122
122
This section is informative. At the time of writing, the following prefixes are known to exist:
A Compose application can declare dependency on another Compose application. This is useful if:
13
+
You can reuse and modularize Docker Compose configurations by including other Compose files. This is useful if:
13
14
- You want to reuse other Compose files.
14
15
- You need to factor out parts of your application model into separate Compose files so they can be managed separately or shared with others.
15
-
- Teams need to keep a Compose file reasonably complicated for the limited amount of resources it has to declare for its own sub-domain within a larger deployment.
16
+
- Teams need to maintain a Compose file with only necessary complexity for the limited amount of resources it has to declare for its own sub-domain within a larger deployment.
16
17
17
18
The `include` top-level section is used to define the dependency on another Compose application, or sub-domain.
18
19
Each path listed in the `include` section is loaded as an individual Compose application model, with its own project directory, in order to resolve relative paths.
0 commit comments