@@ -72,31 +72,35 @@ def run_compose_command(service_name, command, build=False):
7272 cmd = ['docker' , 'compose' ]
7373
7474 # Handle speaker-recognition service specially
75- if service_name == 'speaker-recognition' and command == 'up' :
76- # Read configuration to determine how to start
75+ if service_name == 'speaker-recognition' and command in [ 'up' , 'down' ] :
76+ # Read configuration to determine profile
7777 env_file = service_path / '.env'
7878 if env_file .exists ():
7979 env_values = dotenv_values (env_file )
8080 compute_mode = env_values .get ('COMPUTE_MODE' , 'cpu' )
81- https_enabled = env_values .get ('REACT_UI_HTTPS' , 'false' )
82-
83- if https_enabled .lower () == 'true' :
84- # HTTPS mode: start with profile for all services (includes nginx)
85- if compute_mode == 'gpu' :
86- cmd .extend (['--profile' , 'gpu' ])
87- else :
88- cmd .extend (['--profile' , 'cpu' ])
89- cmd .extend (['up' , '-d' ])
81+
82+ # Add profile flag for both up and down commands
83+ if compute_mode == 'gpu' :
84+ cmd .extend (['--profile' , 'gpu' ])
9085 else :
91- # HTTP mode: start specific services with profile (no nginx)
92- if compute_mode == 'gpu' :
93- cmd .extend (['--profile' , 'gpu' ])
86+ cmd .extend (['--profile' , 'cpu' ])
87+
88+ if command == 'up' :
89+ https_enabled = env_values .get ('REACT_UI_HTTPS' , 'false' )
90+ if https_enabled .lower () == 'true' :
91+ # HTTPS mode: start with profile for all services (includes nginx)
92+ cmd .extend (['up' , '-d' ])
9493 else :
95- cmd .extend (['--profile' , 'cpu' ])
96- cmd .extend (['up' , '-d' , 'speaker-service-gpu' if compute_mode == 'gpu' else 'speaker-service-cpu' , 'web-ui' ])
94+ # HTTP mode: start specific services with profile (no nginx)
95+ cmd .extend (['up' , '-d' , 'speaker-service-gpu' if compute_mode == 'gpu' else 'speaker-service-cpu' , 'web-ui' ])
96+ elif command == 'down' :
97+ cmd .extend (['down' ])
9798 else :
98- # Fallback: just start base service
99- cmd .extend (['up' , '-d' ])
99+ # Fallback: no profile
100+ if command == 'up' :
101+ cmd .extend (['up' , '-d' ])
102+ elif command == 'down' :
103+ cmd .extend (['down' ])
100104 else :
101105 # Standard compose commands for other services
102106 if command == 'up' :
0 commit comments