Skip to content

Commit ae59cf1

Browse files
committed
correct compose down example with profile
The down command used with profile will stop the services with a given profile but also all the services without any profiles Signed-off-by: Guillaume Lours <[email protected]>
1 parent 8dbdd7f commit ae59cf1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Profiles help you adjust your Compose application for different environments or use cases by selectively activating services. Services can be assigned to one or more profiles; unassigned services start by default, while assigned ones only start when their profile is active. This setup means specific services, like those for debugging or development, to be included in a single `compose.yml` file and activated only as needed.
1+
Profiles help you adjust your Compose application for different environments or use cases by selectively activating services. Services can be assigned to one or more profiles; unassigned services start/stop by default, while assigned ones only start/stop when their profile is active. This setup means specific services, like those for debugging or development, to be included in a single `compose.yml` file and activated only as needed.

content/manuals/compose/how-tos/profiles.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ $ docker compose --profile dev up phpmyadmin
175175
$ COMPOSE_PROFILES=dev docker compose up phpmyadmin
176176
```
177177

178-
## Stop specific profiles
178+
## Stop application and services with specific profiles
179179

180180
As with starting specific profiles, you can use the `--profile` [command-line option](/reference/cli/docker/compose.md#use--p-to-specify-a-project-name) or
181181
use the [`COMPOSE_PROFILES` environment variable](environment-variables/envvars.md#compose_profiles):
@@ -187,7 +187,7 @@ $ docker compose --profile debug down
187187
$ COMPOSE_PROFILES=debug docker compose down
188188
```
189189

190-
Both commands stop and remove services with the `debug` profile. In the following `compose.yaml` file, this stops the services `db` and `phpmyadmin`.
190+
Both commands stop and remove services with the `debug` profile and services without a profile. In the following `compose.yaml` file, this stops the services `db`, `backend` and `phpmyadmin`.
191191

192192
```yaml
193193
services:
@@ -207,6 +207,15 @@ services:
207207
image: mysql
208208
```
209209

210+
if you only want to stop the `phpmyadmin` service, you can run
211+
```console
212+
$ docker compose down phpmyadmin
213+
```
214+
or
215+
```console
216+
$ docker compose stop phpmyadmin
217+
```
218+
210219
> [!NOTE]
211220
>
212221
> Running `docker compose down` only stops `backend` and `db`.

0 commit comments

Comments
 (0)