This commit is contained in:
2026-01-21 20:28:26 -06:00
parent 2464a57a42
commit 7f749380ff
49 changed files with 1264 additions and 1305 deletions

View File

@@ -0,0 +1,34 @@
from __future__ import annotations
from collections.abc import Iterator
from pathlib import Path
from typing import TYPE_CHECKING, final
from pydantic.dataclasses import dataclass
from docker_compose import ROOT
if TYPE_CHECKING:
from docker_compose.domain.render.render import Render
@final
@dataclass(frozen=True, slots=True)
class BindVols:
# data_rep = Replace("data", str(DATA_ROOT))
render: Render
def __call__(self):
# def mk_bind_vols(self) -> None:
for path in self:
path.mkdir(parents=True, exist_ok=True)
def __iter__(self) -> Iterator[Path]:
for app in self.render.template.services:
for vol in app.volumes:
path = Path(self.render.org_data(vol.src))
if ROOT not in path.parents:
continue
if not path.is_dir():
continue
yield path