From 5d909ca188b6a23ea28ba52ab626b150367a37ec Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Wed, 2 Jul 2025 09:58:00 -0600 Subject: [PATCH] Enhance stop_existing_containers function to conditionally include Supabase Docker Compose file - Updated the logic to check for the existence of the Supabase Docker Compose file before including it in the 'down' command. - This change ensures that Supabase services are properly stopped even if they were disabled in the .env file during the last run. --- start_services.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/start_services.py b/start_services.py index 626ee50..fd43423 100755 --- a/start_services.py +++ b/start_services.py @@ -67,8 +67,13 @@ def stop_existing_containers(): "-p", "localai", "-f", "docker-compose.yml" ] - if is_supabase_enabled(): - cmd.extend(["-f", "supabase/docker/docker-compose.yml"]) + # Check if the Supabase Docker Compose file exists. If so, include it in the + # 'down' command to ensure Supabase services are stopped, even if they've been + # disabled in the .env file since the last run. + supabase_compose_path = os.path.join("supabase", "docker", "docker-compose.yml") + if os.path.exists(supabase_compose_path): + cmd.extend(["-f", supabase_compose_path]) + cmd.append("down") run_command(cmd)