From ddd8e9750b4bd141d0dff641a8e7022ae0ab9eec Mon Sep 17 00:00:00 2001 From: aevesdocker Date: Wed, 4 Sep 2024 14:41:22 +0100 Subject: [PATCH 1/3] ENGDOCS-2203 --- content/manuals/compose/profiles.md | 38 ++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/content/manuals/compose/profiles.md b/content/manuals/compose/profiles.md index e9bcff0ba8f5..dad5e3a9aa08 100644 --- a/content/manuals/compose/profiles.md +++ b/content/manuals/compose/profiles.md @@ -59,7 +59,7 @@ $ COMPOSE_PROFILES=debug docker compose up ``` The above commands would both start your application with the `debug` profile enabled. -In the example, `compose.yml` file above, this starts the services `backend`, +In the example, `compose.yml` file above, this starts the services `db` and `phpmyadmin`. ### Start multiple profiles @@ -173,6 +173,42 @@ $ docker compose --profile dev up phpmyadmin $ COMPOSE_PROFILES=dev docker compose up phpmyadmin ``` +## Stop specific profiles + +As with starting specific profiles, you can use the `--profile` [command-line option](reference/index.md) or +use the [`COMPOSE_PROFILES` environment variable](environment-variables/envvars.md#compose_profiles): + +```console +$ docker compose --profile debug down +``` +```console +$ COMPOSE_PROFILES=debug docker compose down +``` + +Both commands above would stop and remove services with the `debug` profile. In the following `compose.yml` file, this stops the services `db` and `phpmyadmin`. + +```yaml +services: + frontend: + image: frontend + profiles: [frontend] + + phpmyadmin: + image: phpmyadmin + depends_on: [db] + profiles: [debug] + + backend: + image: backend + + db: + image: mysql +``` + +> [!NOTE] +> +> Running `docker compose down` only stops `backend` and `db`. + ## Reference information [`profiles`](/reference/compose-file/services.md#profiles) From 2d432fa576652aea2578fc861aa8dd1d6436ed39 Mon Sep 17 00:00:00 2001 From: aevesdocker Date: Wed, 4 Sep 2024 14:55:39 +0100 Subject: [PATCH 2/3] vale fix --- content/manuals/compose/profiles.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/manuals/compose/profiles.md b/content/manuals/compose/profiles.md index dad5e3a9aa08..74e4fe726da4 100644 --- a/content/manuals/compose/profiles.md +++ b/content/manuals/compose/profiles.md @@ -58,8 +58,8 @@ $ docker compose --profile debug up $ COMPOSE_PROFILES=debug docker compose up ``` -The above commands would both start your application with the `debug` profile enabled. -In the example, `compose.yml` file above, this starts the services +Both commands start the servies with the `debug` profile enabled. +In the previous `compose.yml` file, this starts the services `db` and `phpmyadmin`. ### Start multiple profiles @@ -185,7 +185,7 @@ $ docker compose --profile debug down $ COMPOSE_PROFILES=debug docker compose down ``` -Both commands above would stop and remove services with the `debug` profile. In the following `compose.yml` file, this stops the services `db` and `phpmyadmin`. +Both commands stop and remove services with the `debug` profile. In the following `compose.yml` file, this stops the services `db` and `phpmyadmin`. ```yaml services: From 3b34cde7199e2febe2ff3c2221d1e3779d8b6987 Mon Sep 17 00:00:00 2001 From: Allie Sadler <102604716+aevesdocker@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:27:27 +0100 Subject: [PATCH 3/3] Update content/manuals/compose/profiles.md --- content/manuals/compose/profiles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/manuals/compose/profiles.md b/content/manuals/compose/profiles.md index 74e4fe726da4..a9416d27e350 100644 --- a/content/manuals/compose/profiles.md +++ b/content/manuals/compose/profiles.md @@ -58,7 +58,7 @@ $ docker compose --profile debug up $ COMPOSE_PROFILES=debug docker compose up ``` -Both commands start the servies with the `debug` profile enabled. +Both commands start the services with the `debug` profile enabled. In the previous `compose.yml` file, this starts the services `db` and `phpmyadmin`.