24 lines
599 B
Python
24 lines
599 B
Python
"""Environment configuration derived from environment variables."""
|
|
|
|
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings."""
|
|
|
|
service_name: str = "backend"
|
|
environment: str = "development"
|
|
database_url: str = (
|
|
"postgresql+psycopg://postgres:postgres@postgres:5432/avaaz"
|
|
)
|
|
|
|
model_config = SettingsConfigDict(env_prefix="", case_sensitive=False)
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def get_settings() -> Settings:
|
|
"""Return cached settings instance."""
|
|
return Settings()
|