From ef68937d4b478ffde7a2f7f2af566bb3e01101d8 Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Tue, 9 Dec 2025 18:45:47 -0700 Subject: [PATCH] fix: add --remove-orphans to main compose up command prevents container name conflicts when switching profiles by cleaning up orphaned containers from deactivated services --- start_services.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start_services.py b/start_services.py index 14c6a13..4385fdd 100755 --- a/start_services.py +++ b/start_services.py @@ -237,8 +237,9 @@ def start_local_ai(): run_command(build_cmd) # Now, start the services using the newly built images. No --build needed as we just built. + # Use --remove-orphans to clean up containers from profiles that are no longer active print("Starting containers...") - up_cmd = ["docker", "compose"] + compose_files + ["up", "-d"] + up_cmd = ["docker", "compose"] + compose_files + ["up", "-d", "--remove-orphans"] run_command(up_cmd) def generate_searxng_secret_key():