Implementar MARGARET - Log de entrada CORP

- app.py: API Flask con endpoints /health, /ingest, /query, /list
- Dockerfile y docker-compose.yml para despliegue
- init.sql para crear tabla margaret_log
- Autenticacion via X-Auth-Key (h_instancia)
- Almacenamiento en R2 y PostgreSQL

Desplegado en CORP (92.112.181.188:5051)
This commit is contained in:
ARCHITECT
2025-12-24 09:31:46 +00:00
parent cad1163cd8
commit 1c3eace6bc
8 changed files with 391 additions and 28 deletions

27
docker-compose.yml Normal file
View File

@@ -0,0 +1,27 @@
version: "3.8"
services:
margaret:
build: .
container_name: margaret-service
restart: unless-stopped
ports:
- "5051:5051"
environment:
- H_INSTANCIA=${H_INSTANCIA}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- R2_ENDPOINT=${R2_ENDPOINT}
- R2_ACCESS_KEY=${R2_ACCESS_KEY}
- R2_SECRET_KEY=${R2_SECRET_KEY}
- R2_BUCKET=${R2_BUCKET}
- PORT=5051
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5051/health"]
interval: 30s
timeout: 10s
retries: 3