Skip to content

Commit 39917f9

Browse files
committed
add more properties
1 parent 41dd1f9 commit 39917f9

File tree

1 file changed

+62
-4
lines changed

1 file changed

+62
-4
lines changed

docs/concepts/compose-support.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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.
44
sidebar_position: 160
55
---
66

@@ -26,16 +26,36 @@ services:
2626
## Compose Top-level Properties
2727
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.
2828

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+
2940
### `version`
3041
(Deprecated)
3142

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+
```
3348

3449
### `volumes`
3550
(Unsupported)
3651

3752
The volume mounts for a container, reusable across services. This feature is not currently supported by Defang.
3853

54+
```yaml
55+
volumes: # unsupported
56+
db-data:
57+
```
58+
3959
## Compose Service Properties
4060
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.
4161

@@ -87,14 +107,30 @@ deploy:
87107
memory: 256M
88108
```
89109

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+
90120
### `environment`
91121
(Optional)
92122

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.
94124

95125
```yaml
96126
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
98134
```
99135

100136
### `healthcheck`
@@ -123,6 +159,24 @@ The image to run.
123159
image: nginx:latest
124160
```
125161

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+
126180
### `ports`
127181
(Optional, but required if you want to access the service from outside the container)
128182

@@ -153,6 +207,10 @@ restart: unless-stopped
153207

154208
The volume mounts for a container, specific to a service. This feature is not currently supported by Defang.
155209

210+
```yaml
211+
volumes: # unsupported
212+
- "./backend:/app"
213+
```
156214

157215
### Configuration
158216
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

Comments
 (0)