Skip to content

Commit 59da76b

Browse files
committed
fix: profiles is supported for all compose commands
1 parent 0970743 commit 59da76b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/testcontainers/compose/compose.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ def compose_command_property(self) -> list[str]:
199199
if self.compose_file_name:
200200
for file in self.compose_file_name:
201201
docker_compose_cmd += ["-f", file]
202+
if self.profiles:
203+
docker_compose_cmd += [item for profile in self.profiles for item in ["--profile", profile]]
202204
if self.env_file:
203205
docker_compose_cmd += ["--env-file", self.env_file]
204206
return docker_compose_cmd
@@ -226,9 +228,6 @@ def start(self) -> None:
226228
# we run in detached mode instead of blocking
227229
up_cmd.append("--detach")
228230

229-
if self.profiles:
230-
up_cmd.extend([item for profile in self.profiles for item in ["--profile", profile]])
231-
232231
if self.services:
233232
up_cmd.extend(self.services)
234233

0 commit comments

Comments
 (0)