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-support.md
+62-4Lines changed: 62 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Compose Support
3
-
description: Defang supports many of the properties of the Compose specification.
3
+
description: Defang supports many properties of the Compose specification.
4
4
sidebar_position: 160
5
5
---
6
6
@@ -26,16 +26,36 @@ services:
26
26
## Compose Top-level Properties
27
27
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.
28
28
29
+
### `services`
30
+
(Required)
31
+
32
+
The services defined in your application.
33
+
34
+
```yaml
35
+
services:
36
+
service:
37
+
# add service-level properties here
38
+
```
39
+
29
40
### `version`
30
41
(Deprecated)
31
42
32
-
The version of the Compose file format being used. This feature is no longer supported and will be ignored by Defang.
43
+
The version of the Compose file format being used. This feature is deprecated and will be ignored by Defang.
44
+
45
+
```yaml
46
+
version: '3' # deprecated
47
+
```
33
48
34
49
### `volumes`
35
50
(Unsupported)
36
51
37
52
The volume mounts for a container, reusable across services. This feature is not currently supported by Defang.
38
53
54
+
```yaml
55
+
volumes: # unsupported
56
+
db-data:
57
+
```
58
+
39
59
## Compose Service Properties
40
60
Here are a list of service-level properties of the [Compose specification](https://docs.docker.com/compose/compose-file/) that Defang supports when writing a `compose.yaml` file.
41
61
@@ -87,14 +107,30 @@ deploy:
87
107
memory: 256M
88
108
```
89
109
110
+
### `depends_on`
111
+
(Unsupported)
112
+
113
+
The services that need to be started before this service can run. This feature is currently unsupported by Defang, but can be useful in local developments such as Docker.
114
+
115
+
```yaml
116
+
depends_on: # unsupported
117
+
- db
118
+
```
119
+
90
120
### `environment`
91
121
(Optional)
92
122
93
-
The environment variables to set.
123
+
The environment variables to set. For sensitive environment variables, you can set them with a blank or `null` value. See our page on [Configuration](/docs/concepts/configuration) for more.
94
124
95
125
```yaml
96
126
environment:
97
-
MYSQL_ROOT_PASSWORD: example
127
+
DATABASE_USER: someuser
128
+
DATABASE_PASSWORD: # leave blank/null to set config
129
+
```
130
+
The above is called *map notation*. You can also use *list notation* as seen below:
131
+
```yaml
132
+
environment:
133
+
- DATABASE_PASSWORD
98
134
```
99
135
100
136
### `healthcheck`
@@ -123,6 +159,24 @@ The image to run.
123
159
image: nginx:latest
124
160
```
125
161
162
+
### `networks`
163
+
(Optional)
164
+
165
+
The network configuration. Can be `public`, where Defang will assign a public IP address, or `private`, in which Defang will not.
166
+
167
+
```yaml
168
+
networks:
169
+
public:
170
+
```
171
+
172
+
You can also assign an alias for a network by using `aliases`, as seen below:
173
+
```yaml
174
+
networks:
175
+
public:
176
+
aliases:
177
+
- app
178
+
```
179
+
126
180
### `ports`
127
181
(Optional, but required if you want to access the service from outside the container)
128
182
@@ -153,6 +207,10 @@ restart: unless-stopped
153
207
154
208
The volume mounts for a container, specific to a service. This feature is not currently supported by Defang.
155
209
210
+
```yaml
211
+
volumes: # unsupported
212
+
- "./backend:/app"
213
+
```
156
214
157
215
### Configuration
158
216
You can define sensitive environment variables/configuration for Defang by writing out the variable name and leaving it in as a blank or `null` value in the Compose file. See our [Configuration](/docs/concepts/configuration) page for more.
0 commit comments