Added Documents Feature

This commit is contained in:
Eric Gullickson
2025-09-28 20:35:46 -05:00
parent 2e1b588270
commit 775a1ff69e
66 changed files with 5655 additions and 944 deletions

View File

@@ -1,5 +1,7 @@
# MVP Platform Vehicles Service
For full platform architecture and integration patterns, see `docs/PLATFORM-SERVICES.md`.
## Schema Bootstrapping (Docker-First)
- Database: PostgreSQL, service `mvp-platform-vehicles-db`.
- On first start, schema files from `mvp-platform-services/vehicles/sql/schema` are executed automatically because the folder is mounted to `/docker-entrypoint-initdb.d` in `docker-compose.yml`.

View File

@@ -2,18 +2,28 @@ import os
from pydantic_settings import BaseSettings
from typing import List
# Docker-first: load secrets from mounted files when env vars are absent
_PG_SECRET_FILE = os.getenv("POSTGRES_PASSWORD_FILE", "/run/secrets/postgres-password")
if not os.getenv("POSTGRES_PASSWORD"):
try:
with open(_PG_SECRET_FILE, 'r') as f:
os.environ["POSTGRES_PASSWORD"] = f.read().strip()
except Exception:
# Leave as-is; connection will fail loudly if missing
pass
class Settings(BaseSettings):
"""Application configuration"""
# Database settings
POSTGRES_HOST: str = os.getenv("POSTGRES_HOST", "localhost")
POSTGRES_HOST: str = os.getenv("POSTGRES_HOST", "mvp-platform-vehicles-db")
POSTGRES_PORT: int = int(os.getenv("POSTGRES_PORT", "5432"))
POSTGRES_USER: str = os.getenv("POSTGRES_USER", "mvp_platform_user")
POSTGRES_PASSWORD: str = os.getenv("POSTGRES_PASSWORD", "platform123")
POSTGRES_DATABASE: str = os.getenv("POSTGRES_DATABASE", "vpic")
POSTGRES_PASSWORD: str = os.getenv("POSTGRES_PASSWORD", "")
POSTGRES_DATABASE: str = os.getenv("POSTGRES_DATABASE", "vehicles")
# Redis settings
REDIS_HOST: str = os.getenv("REDIS_HOST", "localhost")
REDIS_HOST: str = os.getenv("REDIS_HOST", "mvp-platform-vehicles-redis")
REDIS_PORT: int = int(os.getenv("REDIS_PORT", "6379"))
REDIS_DB: int = int(os.getenv("REDIS_DB", "0"))
@@ -40,4 +50,4 @@ class Settings(BaseSettings):
def get_settings() -> Settings:
"""Get application settings"""
return Settings()
return Settings()