Deploy inicial: API FastAPI + infra Podman/Caddy + docs
- App FastAPI (main.py, app/): rotas /health e /dados_retorno, middleware anti-scanner, logging configurado - Config via configs.json (Pydantic); segredos fora do codigo e do git (.gitignore) - Dockerfile (oracledb thin, HEALTHCHECK) + requirements.txt + .dockerignore - Deploy Podman/Quadlet + Caddy em deploy/ - Docs: CLAUDE.md + docs/ (arquitetura, deploy, known-issues) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
commit
15c89c9038
22 changed files with 1397 additions and 0 deletions
45
app/config.py
Normal file
45
app/config.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
from pathlib import Path
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class BancoConfig(BaseModel):
|
||||
user: str
|
||||
password: str
|
||||
dns: str
|
||||
instant_client: str
|
||||
|
||||
|
||||
class HolmesConfig(BaseModel):
|
||||
token_api: str
|
||||
usuario: str
|
||||
senha: str
|
||||
|
||||
|
||||
class ApolloConfig(BaseModel):
|
||||
subscription_key: str
|
||||
ambiente: str
|
||||
|
||||
|
||||
class ApiConfig(BaseModel):
|
||||
port: int
|
||||
ambiente: str
|
||||
workers: int
|
||||
|
||||
|
||||
class DocsConfig(BaseModel):
|
||||
user: str
|
||||
password: str
|
||||
|
||||
|
||||
class Settings(BaseModel):
|
||||
banco: BancoConfig
|
||||
holmes: HolmesConfig
|
||||
api: ApiConfig
|
||||
apollo: ApolloConfig
|
||||
docs: DocsConfig
|
||||
log_level: str = "INFO"
|
||||
|
||||
|
||||
_PATH = Path(__file__).resolve().parent.parent / "configs.json"
|
||||
settings = Settings.model_validate_json(_PATH.read_text(encoding="utf-8"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue