2.3 KiB
2.3 KiB
Active Context - api-ubigeo
Última actualización: 2026-03-10
Estado Actual
PRODUCCIÓN ACTIVA — https://api-ubigeo.darkcodex.dev responde correctamente desde internet.
- Health:
GET /api/v1/health→{"status":"ok"} - Distritos:
GET /api/v1/ubigeo/distritos?q=lima&limit=10→ HTTP 200
Decisiones Recientes
2026-03-10
- Traefik en Easypanel usa file provider con
main.yaml— NO esdirectory:, solo lee ese único archivo - El archivo
api-ubigeo.yamlseparado que creamos antes era ignorado por Traefik - Solución: inyectar los routers/services directamente en
main.yamlusandojqvíadocker run -v - El runner de Gitea corre en un contenedor sin acceso directo al host filesystem, pero puede usar
docker run -v /host/path:/container/pathpara acceder a rutas del host main.yamlestá en JSON (no YAML real), Traefik lo acepta igual- Routers agregados:
http-ubigeo-0(redirect https) yhttps-ubigeo-0(TLS letsencrypt) - Service:
ubigeo_api-0→http://ubigeo-api:3200/
Infraestructura
Contenedor
- Imagen:
ubigeo-api:latest(multi-stage build, node:20-alpine) - Puerto interno: 3200
- Redes:
api-ubigeo_ubigeo_network+easypanel - Deploy path:
/home/deployer/api-ubigeo/
Traefik
- Config file:
/etc/easypanel/traefik/config/main.yaml(JSON) - El CI inyecta routers via
jqcondocker run -v - Idempotente: verifica si
https-ubigeo-0ya existe antes de agregar
CI/CD
- Gitea runner:
contabo-runnerengitea_gitea_net - Runner corre en contenedor pero con acceso a Docker socket del host
- Workflow:
.github/workflows/deploy.yml - Run exitoso: #29
Pendiente Próxima Sesión
- Nada crítico en api-ubigeo
- Pendiente en Impulsa Mobile: probar autocomplete de distrito con API live
Contexto Técnico
Workarounds
main.yamlse sobreescribe en cada deploy de Easypanel → el CI debe reinjectar la ruta si eso ocurre- El step
Register Traefik routees idempotente (no duplica si ya existe)
Archivos Clave
.github/workflows/deploy.yml— CI/CD completodocker-compose.production.yml— producción con red easypanelscripts/register-traefik.sh— script legacy (ya no se usa, se puede eliminar)src/modules/ubigeo/ubigeo.controller.ts— endpointssrc/modules/ubigeo/dto/ubigeo.dto.ts— DTOs