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: docs/concepts/compose.md
+38-38Lines changed: 38 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,18 +38,6 @@ services:
38
38
## Compose Top-level Properties
39
39
Here are a list of top-level properties of the [Compose specification](https://docs.docker.com/compose/compose-file/) that Defang supports when writing a `compose.yaml` file.
40
40
41
-
### `networks`
42
-
(Optional)
43
-
44
-
The networks defined in your application. This is commonly added together with a [service-level `networks`](#networks-1) property.
45
-
46
-
```yaml
47
-
networks:
48
-
public:
49
-
```
50
-
51
-
See our [Networking](/docs/concepts/networking) page for more.
52
-
53
41
### `services`
54
42
(Required)
55
43
@@ -62,9 +50,21 @@ services:
62
50
```
63
51
64
52
:::info
65
-
Defang identifies services by the [account username](./accounts.md) and the service name (as defined in the `compose.yaml` file). This means that if you have multiple Defang projects with the same service name, they will conflict with each other. See our [Services](/docs/concepts/services) page for more.
53
+
Defang identifies a service based on your username, project name, and the service name you've defined under the `services` property. See our [Services](/docs/concepts/services) page for more about how Defang resolves service names.
66
54
:::
67
55
56
+
### `networks`
57
+
(Optional)
58
+
59
+
The networks defined in your application. This is commonly added together with a [service-level `networks`](#networks-1) property.
60
+
61
+
```yaml
62
+
networks:
63
+
public:
64
+
```
65
+
66
+
See our [Networking](/docs/concepts/networking) page for more.
67
+
68
68
### `volumes`
69
69
(Not yet supported)
70
70
@@ -108,6 +108,31 @@ build:
108
108
dockerfile: ./Dockerfile
109
109
```
110
110
111
+
### `image`
112
+
(Required, unless `build` is defined)
113
+
114
+
[This property](https://github.com/compose-spec/compose-spec/blob/main/05-services.md#image) describes the image from which your container should start.
115
+
116
+
```yaml
117
+
image: nginx:latest
118
+
```
119
+
120
+
### `ports`
121
+
(Optional, but required if you want to access the service from outside the container)
122
+
123
+
The ports to expose. The default port mode is `ingress`.
124
+
125
+
```yaml
126
+
ports:
127
+
- mode: ingress
128
+
target: 80
129
+
published: 80
130
+
```
131
+
132
+
:::info
133
+
Defang ignores `published` ports in production. As such, it is common to make `target` and `published` ports the same when using Defang. However, it can be useful to include a `published` port for local development, such as Docker.
134
+
:::
135
+
111
136
### `command`
112
137
(Optional)
113
138
@@ -187,15 +212,6 @@ healthcheck:
187
212
retries: 3
188
213
```
189
214
190
-
### `image`
191
-
(Required, unless `build` is defined)
192
-
193
-
[This property](https://github.com/compose-spec/compose-spec/blob/main/05-services.md#image) describes the image from which your container should start.
194
-
195
-
```yaml
196
-
image: nginx:latest
197
-
```
198
-
199
215
### `networks`
200
216
(Optional)
201
217
@@ -216,22 +232,6 @@ networks:
216
232
217
233
See our [Networking](/docs/concepts/networking) page for more.
218
234
219
-
### `ports`
220
-
(Optional, but required if you want to access the service from outside the container)
221
-
222
-
The ports to expose. The default port mode is `ingress`.
223
-
224
-
```yaml
225
-
ports:
226
-
- mode: ingress
227
-
target: 80
228
-
published: 80
229
-
```
230
-
231
-
:::info
232
-
Defang ignores `published` ports in production. As such, it is common to make `target` and `published` ports the same when using Defang. However, it can be useful to include a `published` port for local development, such as Docker.
0 commit comments