feat: Add Render.com deployment support with production data
Render Configuration: - render.yaml for declarative deployment - requirements-dashboard.txt (lightweight deps for cloud) - Updated .streamlit/config.toml for production - Updated app.py to auto-detect production vs local data Production Data: - Added data/production/test-07/ with 30 real call analyses - Updated .gitignore to allow data/production/ Documentation: - Added Render.com section to DEPLOYMENT.md with step-by-step guide Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -887,3 +887,154 @@ make logs
|
||||
make status
|
||||
make dashboard BATCH=batch_01
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Render.com (Dashboard Cloud)
|
||||
|
||||
Para publicar el dashboard en una URL publica usando Render.com.
|
||||
|
||||
### Prerrequisitos
|
||||
|
||||
1. Cuenta en [Render.com](https://render.com) (plan Free disponible)
|
||||
2. Repositorio Git subido (ej: `https://git.beyondcx.org/susana/BeyondCX_Insights.git`)
|
||||
3. Datos de produccion en `data/production/` (ya incluido)
|
||||
|
||||
---
|
||||
|
||||
### Paso 1: Crear cuenta en Render
|
||||
|
||||
1. Ve a [https://render.com](https://render.com)
|
||||
2. Click en **Get Started for Free**
|
||||
3. Registrate con GitHub, GitLab, o email
|
||||
|
||||
---
|
||||
|
||||
### Paso 2: Conectar repositorio Git
|
||||
|
||||
1. En el Dashboard de Render, click **New +** > **Web Service**
|
||||
2. Selecciona **Build and deploy from a Git repository**
|
||||
3. Click **Next**
|
||||
|
||||
**Configurar acceso al repositorio:**
|
||||
|
||||
- **Repositorio publico**: Pega la URL directamente
|
||||
- **Repositorio privado**:
|
||||
1. Click **Connect account** para GitHub/GitLab
|
||||
2. O usa **Public Git repository** con URL
|
||||
|
||||
Para `git.beyondcx.org`:
|
||||
- URL: `https://git.beyondcx.org/susana/BeyondCX_Insights.git`
|
||||
- Render pedira credenciales si es privado
|
||||
|
||||
---
|
||||
|
||||
### Paso 3: Configurar el servicio
|
||||
|
||||
Completa los campos:
|
||||
|
||||
| Campo | Valor |
|
||||
|-------|-------|
|
||||
| **Name** | `cxinsights-dashboard` |
|
||||
| **Region** | `Frankfurt (EU Central)` |
|
||||
| **Branch** | `master` |
|
||||
| **Runtime** | `Python 3` |
|
||||
| **Build Command** | `pip install -r requirements-dashboard.txt` |
|
||||
| **Start Command** | `streamlit run dashboard/app.py --server.port $PORT --server.address 0.0.0.0 --server.headless true` |
|
||||
|
||||
**Plan:**
|
||||
- **Free**: Para demos y pruebas (se apaga tras 15 min inactividad)
|
||||
- **Starter ($7/mes)**: Para produccion (siempre activo)
|
||||
|
||||
---
|
||||
|
||||
### Paso 4: Variables de entorno
|
||||
|
||||
Click en **Advanced** y añade:
|
||||
|
||||
| Key | Value |
|
||||
|-----|-------|
|
||||
| `PYTHON_VERSION` | `3.11.0` |
|
||||
| `RENDER` | `true` |
|
||||
| `STREAMLIT_SERVER_HEADLESS` | `true` |
|
||||
| `STREAMLIT_BROWSER_GATHER_USAGE_STATS` | `false` |
|
||||
|
||||
---
|
||||
|
||||
### Paso 5: Deploy
|
||||
|
||||
1. Click **Create Web Service**
|
||||
2. Render clonara el repo y ejecutara el build
|
||||
3. Espera ~3-5 minutos para el primer deploy
|
||||
|
||||
**Ver logs:** En la pagina del servicio, click en **Logs**
|
||||
|
||||
---
|
||||
|
||||
### Paso 6: Acceder al dashboard
|
||||
|
||||
Una vez desplegado:
|
||||
|
||||
- URL publica: `https://cxinsights-dashboard.onrender.com`
|
||||
- (El subdominio exacto depende de disponibilidad)
|
||||
|
||||
---
|
||||
|
||||
### Actualizaciones automaticas
|
||||
|
||||
Por defecto, Render hace auto-deploy cuando:
|
||||
- Push a la branch `master`
|
||||
- Merge de PR
|
||||
|
||||
Para desactivar: **Settings** > **Build & Deploy** > **Auto-Deploy** > Off
|
||||
|
||||
---
|
||||
|
||||
### Actualizar datos de produccion
|
||||
|
||||
Para cambiar los datos mostrados en el dashboard:
|
||||
|
||||
```bash
|
||||
# 1. Copiar nuevo batch a produccion
|
||||
cp -r data/output/nuevo-batch/* data/production/nuevo-batch/
|
||||
|
||||
# 2. Commit y push
|
||||
git add data/production/
|
||||
git commit -m "Update production data with nuevo-batch"
|
||||
git push origin master
|
||||
|
||||
# 3. Render auto-deploys (o manual redeploy)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Troubleshooting Render
|
||||
|
||||
**Error: "No batch data found"**
|
||||
- Verifica que `data/production/` tiene datos
|
||||
- Ejecuta `git status` para confirmar que no esta gitignored
|
||||
|
||||
**Error: Build failed**
|
||||
- Revisa logs de build en Render
|
||||
- Verifica `requirements-dashboard.txt` tiene todas las dependencias
|
||||
|
||||
**Dashboard muy lento**
|
||||
- Plan Free tiene recursos limitados (512 MB RAM)
|
||||
- Considera upgrade a Starter ($7/mes)
|
||||
|
||||
**Se apaga tras inactividad (Free plan)**
|
||||
- Comportamiento normal del plan Free
|
||||
- El primer request despues de apagarse toma ~30 segundos
|
||||
- Upgrade a Starter para siempre activo
|
||||
|
||||
---
|
||||
|
||||
### Costes estimados Render
|
||||
|
||||
| Plan | Precio | RAM | Uso recomendado |
|
||||
|------|--------|-----|-----------------|
|
||||
| Free | $0/mes | 512 MB | Demos, pruebas |
|
||||
| Starter | $7/mes | 512 MB | Produccion ligera |
|
||||
| Standard | $25/mes | 2 GB | Produccion con SLA |
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user