fix: Docker reload
This commit is contained in:
parent
092a791cc0
commit
1a1eeb7729
1 changed files with 6 additions and 8 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from python_on_whales import DockerClient
|
||||
from injectable import injectable
|
||||
|
||||
from karl.model.containers import Tree, Compose, SimpleContainer
|
||||
from python_on_whales import DockerClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -15,8 +14,7 @@ class DockerService:
|
|||
self._client = DockerClient()
|
||||
|
||||
def reload(self, compose_path: Path):
|
||||
projects = self._client.compose.ps()
|
||||
logger.info(f"Found {len(projects)} projects")
|
||||
from python_on_whales.components.compose.models import ComposeProject
|
||||
for project in projects:
|
||||
logger.info(f"Found project {project}")
|
||||
os.chdir(compose_path.parent)
|
||||
self._client.compose.ps()
|
||||
self._client.compose.down(remove_orphans=True)
|
||||
self._client.compose.up()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue