Add base kubernetes support
This commit is contained in:
@@ -20,9 +20,23 @@ class ProductionSettings(BaseServiceSettings):
|
||||
VERSION: str = "1.0.0"
|
||||
DESCRIPTION: str = "Production planning and batch management"
|
||||
|
||||
# Database Configuration
|
||||
DATABASE_URL: str = os.getenv("PRODUCTION_DATABASE_URL",
|
||||
"postgresql+asyncpg://production_user:production_pass123@production-db:5432/production_db")
|
||||
# Database configuration (secure approach - build from components)
|
||||
@property
|
||||
def DATABASE_URL(self) -> str:
|
||||
"""Build database URL from secure components"""
|
||||
# Try complete URL first (for backward compatibility)
|
||||
complete_url = os.getenv("PRODUCTION_DATABASE_URL")
|
||||
if complete_url:
|
||||
return complete_url
|
||||
|
||||
# Build from components (secure approach)
|
||||
user = os.getenv("PRODUCTION_DB_USER", "production_user")
|
||||
password = os.getenv("PRODUCTION_DB_PASSWORD", "production_pass123")
|
||||
host = os.getenv("PRODUCTION_DB_HOST", "localhost")
|
||||
port = os.getenv("PRODUCTION_DB_PORT", "5432")
|
||||
name = os.getenv("PRODUCTION_DB_NAME", "production_db")
|
||||
|
||||
return f"postgresql+asyncpg://{user}:{password}@{host}:{port}/{name}"
|
||||
|
||||
# Redis Database (for production queues and caching)
|
||||
REDIS_DB: int = 3
|
||||
|
||||
Reference in New Issue
Block a user