22 lines
562 B
Python
22 lines
562 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
import os
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Settings:
|
|
state_file: str
|
|
docker_api_url: str
|
|
docker_timeout_seconds: float
|
|
app_port: int
|
|
|
|
|
|
def get_settings() -> Settings:
|
|
return Settings(
|
|
state_file=os.getenv("STATE_FILE", "/data/entries.json"),
|
|
docker_api_url=os.getenv("DOCKER_API_URL", "unix:///var/run/docker.sock"),
|
|
docker_timeout_seconds=float(os.getenv("DOCKER_TIMEOUT_SECONDS", "3")),
|
|
app_port=int(os.getenv("APP_PORT", "31810")),
|
|
)
|