163 lines
2.8 KiB
Markdown
163 lines
2.8 KiB
Markdown
# Makers3D - Deployment Runbook
|
|
|
|
## 1. Requisitos
|
|
|
|
- Debian 13
|
|
- Docker
|
|
- Docker Compose
|
|
- 4 GB RAM recomendados
|
|
- 20 GB libres como minimo
|
|
|
|
## 2. Archivos necesarios
|
|
|
|
- `compose.yaml`
|
|
- `.env`
|
|
- carpeta `apps/`
|
|
- carpeta `packages/`
|
|
- carpeta `infrastructure/`
|
|
- carpeta `docs/`
|
|
|
|
## 3. Variables minimas
|
|
|
|
Partir de `.env.example` y ajustar:
|
|
|
|
- `POSTGRES_PASSWORD`
|
|
- `SESSION_SECRET`
|
|
- `APP_URL`
|
|
- `MINIO_ROOT_USER`
|
|
- `MINIO_ROOT_PASSWORD`
|
|
- `PAYMENT_PROVIDER`
|
|
- `MERCADOPAGO_ACCESS_TOKEN` si se activa el proveedor real
|
|
|
|
## 4. Primer despliegue
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
docker compose build
|
|
docker compose up -d
|
|
docker compose exec -T api node apps/api/dist/apps/api/src/scripts/migrate.js
|
|
docker compose exec -T api node apps/api/dist/apps/api/src/scripts/seed.js
|
|
```
|
|
|
|
### Activar HTTPS real en `dev.jazari.com.ar`
|
|
|
|
El proyecto ya incluye estructura para Let's Encrypt con renovacion automatica.
|
|
|
|
1. Ajustar `.env`:
|
|
|
|
- `APP_URL=https://dev.jazari.com.ar`
|
|
|
|
2. Obtener el certificado:
|
|
|
|
```bash
|
|
./scripts/setup-https.sh dev.jazari.com.ar
|
|
```
|
|
|
|
Si se quiere registrar correo en Let's Encrypt:
|
|
|
|
```bash
|
|
./scripts/setup-https.sh dev.jazari.com.ar ops@tu-dominio.com
|
|
```
|
|
|
|
3. Instalar renovacion automatica:
|
|
|
|
```bash
|
|
./scripts/install-cert-renew-cron.sh
|
|
```
|
|
|
|
4. Verificar:
|
|
|
|
```bash
|
|
./scripts/renew-certs.sh
|
|
```
|
|
|
|
## 5. Verificacion inicial
|
|
|
|
```bash
|
|
curl -fsS http://127.0.0.1/api/v1/health
|
|
curl -fsS http://127.0.0.1/api/v1/makers
|
|
```
|
|
|
|
Comprobar tambien:
|
|
|
|
- `https://dev.jazari.com.ar/`
|
|
- `http://SERVER_IP/login`
|
|
- `http://SERVER_IP/account`
|
|
- instalacion PWA en Android desde Chrome: menu > `Instalar app`
|
|
|
|
## 6. Credenciales demo
|
|
|
|
- Admin: `admin@makers3d.local` / `Admin123!`
|
|
- Maker: `maker1@makers3d.local` / `Maker123!`
|
|
- Cliente: `cliente1@makers3d.local` / `Cliente123!`
|
|
|
|
## 7. Actualizacion
|
|
|
|
```bash
|
|
docker compose build
|
|
docker compose up -d
|
|
```
|
|
|
|
Si cambia el esquema:
|
|
|
|
```bash
|
|
docker compose exec -T api node apps/api/dist/apps/api/src/scripts/migrate.js
|
|
```
|
|
|
|
## 8. Logs utiles
|
|
|
|
```bash
|
|
docker compose logs -f api
|
|
docker compose logs -f web
|
|
docker compose logs -f worker
|
|
docker compose logs -f nginx
|
|
docker compose logs -f certbot
|
|
```
|
|
|
|
## 9. Problemas comunes
|
|
|
|
### `api` no arranca
|
|
|
|
Revisar:
|
|
|
|
- `DATABASE_URL`
|
|
- `SESSION_SECRET`
|
|
- credenciales MinIO
|
|
- si el esquema ya fue aplicado
|
|
|
|
### `nginx` no responde
|
|
|
|
Relanzar:
|
|
|
|
```bash
|
|
docker compose up -d nginx
|
|
```
|
|
|
|
Si falla solo la parte TLS:
|
|
|
|
```bash
|
|
cp infrastructure/nginx/nginx.http.conf infrastructure/nginx/runtime/nginx.conf
|
|
docker compose up -d --force-recreate nginx
|
|
./scripts/setup-https.sh dev.jazari.com.ar
|
|
```
|
|
|
|
### El login falla
|
|
|
|
Revisar cookies, `APP_URL` y que el navegador entre por Nginx y no directamente al contenedor.
|
|
|
|
## 10. Corte rapido de la demo
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
Mantiene volumenes.
|
|
|
|
## 11. Borrado completo
|
|
|
|
```bash
|
|
docker compose down -v
|
|
```
|
|
|
|
Elimina datos.
|