first commit
This commit is contained in:
46
docs/DEPLOYMENT.md
Normal file
46
docs/DEPLOYMENT.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Despliegue en mini‑PCs
|
||||
|
||||
## Requisitos
|
||||
- Docker + Docker Compose
|
||||
- Postgres y Redis (opcional)
|
||||
|
||||
## Variables de entorno recomendadas
|
||||
- `DATABASE_URL`
|
||||
- `API_ADMIN_KEY`
|
||||
- `JWT_SECRET`
|
||||
- `INGEST_CRON`
|
||||
- `ALERTS_CRON`
|
||||
- `BACKUP_CRON`
|
||||
- `BACKUP_DIR`
|
||||
- `INGEST_ENABLED`
|
||||
- `ALERTS_ENABLED`
|
||||
- `BACKUP_ENABLED`
|
||||
- `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`, `SMTP_FROM`
|
||||
- `TELEGRAM_BOT_TOKEN`, `TELEGRAM_DEFAULT_CHAT`
|
||||
|
||||
## Arranque rápido (todo‑en‑uno)
|
||||
```bash
|
||||
# Desde la raíz del repo
|
||||
pnpm install
|
||||
pnpm build
|
||||
pnpm start
|
||||
```
|
||||
|
||||
## Arranque con Docker Compose
|
||||
```bash
|
||||
docker compose build
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
## Estrategia recomendada (2 mini‑PCs)
|
||||
1. **Mini‑PC 1**: ejecutar Postgres + Redis + jobs de ingesta.
|
||||
2. **Mini‑PC 2**: ejecutar API + web + backups + alertas.
|
||||
3. Definir `DATABASE_URL` apuntando al Postgres del Mini‑PC 1.
|
||||
|
||||
Sugerencia de flags:
|
||||
- Mini‑PC 1: `INGEST_ENABLED=true`, `ALERTS_ENABLED=false`, `BACKUP_ENABLED=false`.
|
||||
- Mini‑PC 2: `INGEST_ENABLED=false`, `ALERTS_ENABLED=true`, `BACKUP_ENABLED=true`.
|
||||
|
||||
## Backups
|
||||
- Programados por `BACKUP_CRON`.
|
||||
- Manual: `POST /admin/backup/run`.
|
||||
Reference in New Issue
Block a user