Skip to content

Commit c59d8a7

Browse files
authored
ENGDOCS-2203 (#20784)
* ENGDOCS-2203 * vale fix * Update content/manuals/compose/profiles.md
1 parent 52a87f6 commit c59d8a7

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

content/manuals/compose/profiles.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ $ docker compose --profile debug up
5858
$ COMPOSE_PROFILES=debug docker compose up
5959
```
6060

61-
The above commands would both start your application with the `debug` profile enabled.
62-
In the example, `compose.yml` file above, this starts the services `backend`,
61+
Both commands start the services with the `debug` profile enabled.
62+
In the previous `compose.yml` file, this starts the services
6363
`db` and `phpmyadmin`.
6464

6565
### Start multiple profiles
@@ -173,6 +173,42 @@ $ docker compose --profile dev up phpmyadmin
173173
$ COMPOSE_PROFILES=dev docker compose up phpmyadmin
174174
```
175175

176+
## Stop specific profiles
177+
178+
As with starting specific profiles, you can use the `--profile` [command-line option](reference/index.md) or
179+
use the [`COMPOSE_PROFILES` environment variable](environment-variables/envvars.md#compose_profiles):
180+
181+
```console
182+
$ docker compose --profile debug down
183+
```
184+
```console
185+
$ COMPOSE_PROFILES=debug docker compose down
186+
```
187+
188+
Both commands stop and remove services with the `debug` profile. In the following `compose.yml` file, this stops the services `db` and `phpmyadmin`.
189+
190+
```yaml
191+
services:
192+
frontend:
193+
image: frontend
194+
profiles: [frontend]
195+
196+
phpmyadmin:
197+
image: phpmyadmin
198+
depends_on: [db]
199+
profiles: [debug]
200+
201+
backend:
202+
image: backend
203+
204+
db:
205+
image: mysql
206+
```
207+
208+
> [!NOTE]
209+
>
210+
> Running `docker compose down` only stops `backend` and `db`.
211+
176212
## Reference information
177213

178214
[`profiles`](/reference/compose-file/services.md#profiles)

0 commit comments

Comments
 (0)