feat: Allow setting port as PORT env var
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Has been cancelled

This seems important for render hosting, as described in
https://render.com/docs/web-services#port-binding.
This commit is contained in:
Marty Oehme 2025-07-22 06:06:15 +02:00
parent 2da0b90b1b
commit 4ef2ce14d6
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 14 additions and 1 deletions

View file

@ -8,6 +8,16 @@ from dotenv import load_dotenv
_ = load_dotenv()
@dataclass
class AppConfig:
PORT: int
@classmethod
def from_env(cls) -> "AppConfig":
PORT = os.getenv("PORT", "8000")
return cls(PORT=int(PORT))
@dataclass
class AiConfig:
API_KEY: str