feat(docker): add async port change and docker compose reload for services

- Introduce async `change_port` to update service port and reload docker compose
- Add `run_docker_command` for running docker compose commands asynchronously
- Implement `_get_random_port` utility for selecting available ports
- Refactor service discovery and port change logic to use new async methods
- Update proxy and manager logic to support new port change workflow
This commit is contained in:
2026-04-13 20:33:14 +02:00 Unverified
parent 7b540cd0b5
commit 7d176fad39
8 changed files with 90 additions and 30 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ from core.config import settings
from core.mongodb import close_mongodb, init_mongodb
from core.redis import close_redis, init_redis
from core.security import hash_password
from integrations.docker import get_all_services
from integrations.docker import get_all_services_in_dir
from repositories.auth import ensure_auth_indexes, ensure_single_account
from repositories.proxy import ensure_proxy_indexes
@@ -28,7 +28,7 @@ async def lifespan(_: FastAPI):
await ensure_proxy_indexes()
home_dir = str(Path.home())
app.state.services = get_all_services(home_dir) or []
app.state.services = get_all_services_in_dir(home_dir) or []
if not app.state.services:
warning = (
"\n" + "!" * 60 + "\n"