Add base kubernetes support

This commit is contained in:
Urtzi Alfaro
2025-09-27 11:18:13 +02:00
parent a27f159e24
commit 63a3f9c77a
63 changed files with 5826 additions and 170 deletions

View File

@@ -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