docker stuff almost complete

This commit is contained in:
2026-05-06 14:23:28 -06:00
parent fea63bb553
commit 31c567653a
6 changed files with 306 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ from core.config import ConfSettings
Base = declarative_base()
#settings = ConfSettings()
class MetricModel(Base):
"""Modelo SQLAlchemy para métricas en Postgres"""
@@ -28,7 +29,7 @@ class MetricsRepositoryPostgres(MetricsRepository):
"""Implementación de repositorio de métricas con PostgreSQL"""
def __init__(self):
db_url = f"postgresql://voxpopuli:voxpopuli_pass@localhost:5432/voxpopuli_metrics"
db_url = f"postgresql://voxpopuli:voxpopuli_pass@postgres:5432/voxpopuli_metrics"
self.engine = create_engine(db_url, echo=False)
Base.metadata.create_all(self.engine)
self.SessionLocal = sessionmaker(bind=self.engine)