Skip to content

Commit 668a4e0

Browse files
committed
fixes for what is required
1 parent e67d4d6 commit 668a4e0

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

docs/concepts/compose-support.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ Here is a basic `compose.yaml` file that contains all the required properties fo
1212
```yaml
1313
services:
1414
service-example:
15-
restart: unless-stopped # specify a restart mode
16-
image: nginx:latest # specify an image (or a build, as shown below)
15+
image: nginx:latest # specify an image (or a build, as shown below — one of the two is required)
1716
# build:
1817
# context: .
1918
# dockerfile: Dockerfile
2019
ports:
21-
- "8080:80" # specify ports to expose
20+
- mode: ingress # specify ports to expose
21+
target: 8080
22+
published: 80
2223

2324
```
2425

@@ -62,6 +63,20 @@ The command which will be run to start your service. If left out, the command fr
6263
command: nginx -g 'daemon off;'
6364
```
6465

66+
### `deploy`
67+
(Optional)
68+
69+
The runtime constraints or reuqirements for how your services will be deployed and managed across different environments (e.g. memory reservations, replicas, number of CPUs, etc.).
70+
71+
```yaml
72+
deploy:
73+
replicas: 2
74+
reservations:
75+
memory: 256M
76+
cpu: 1
77+
78+
```
79+
6580
### `environment`
6681
(Optional)
6782

@@ -104,9 +119,9 @@ Defang ignores `published` ports in production. As such, it is common to make `t
104119
:::
105120

106121
### `restart`
107-
(Required)
122+
(Optional, but highly recommended)
108123

109-
The restart mode for a container.
124+
The restart mode for a container. Defaults to `unless-stopped` unless otherwise specified.
110125

111126
```yaml
112127
restart: unless-stopped

0 commit comments

Comments
 (0)