79 lines
3.8 KiB
Markdown
79 lines
3.8 KiB
Markdown
# Guía de Despliegue en Coolify desde Servidor Git: Pacifictrans Go
|
|
|
|
Esta guía detalla los pasos para desplegar la plataforma web y API de **Pacifictrans Go** en **Coolify** utilizando el repositorio Git propio de Gitea (`https://gitea.almeira.com.co/carlos/almeira-web.git`), con subdominio oficial en `almeira.com.co` y certificado SSL automático gestionado por Traefik.
|
|
|
|
---
|
|
|
|
## 1. Parámetros del Recurso en Coolify
|
|
|
|
| Parámetro | Valor Oficial |
|
|
| :--- | :--- |
|
|
| **Tipo de Recurso** | Application |
|
|
| **Origen (Git Source)** | Gitea / Git Repository |
|
|
| **URL del Repositorio** | `https://gitea.almeira.com.co/carlos/almeira-web.git` |
|
|
| **Rama (Branch)** | `main` |
|
|
| **Directorio Base (Base Directory)** | `/transporte-cali-buenaventura/backend` |
|
|
| **Build Pack** | `Dockerfile` |
|
|
| **Puerto Expuesto** | `4000` |
|
|
| **FQDN / Dominios** | `https://pacifictrans.almeira.com.co` (o alias `https://transporte.almeira.com.co`) |
|
|
|
|
---
|
|
|
|
## 2. Configuración Paso a Paso en el Panel de Coolify
|
|
|
|
1. **Crear la Aplicación**:
|
|
- En el dashboard de Coolify, entrar a tu proyecto y seleccionar **+ New Resource**.
|
|
- Seleccionar **Application** y luego **Public Repository** o conectar tu cuenta de **Gitea**.
|
|
- Ingresar la URL del repositorio: `https://gitea.almeira.com.co/carlos/almeira-web.git`.
|
|
- Indicar la rama `main`.
|
|
|
|
2. **Configurar el Directorio Base y Build Pack**:
|
|
- En **Base Directory**, escribir: `/transporte-cali-buenaventura/backend`.
|
|
- En **Build Pack**, seleccionar: `Dockerfile`. (Coolify detectará automáticamente el archivo [Dockerfile](file:///c:/Users/Carlos/dev/almeira-web/transporte-cali-buenaventura/backend/Dockerfile) multi-stage optimizado).
|
|
|
|
3. **Asignar el Dominio y Puerto**:
|
|
- En el campo **Domains**, ingresar: `https://pacifictrans.almeira.com.co`.
|
|
- En el campo **Ports Exposes**, definir: `4000`.
|
|
- Traefik generará y renovará automáticamente el certificado Let's Encrypt SSL.
|
|
|
|
4. **Variables de Entorno (Environment Variables)**:
|
|
Pegar las siguientes variables en la pestaña **Environment Variables** de la aplicación en Coolify:
|
|
|
|
```env
|
|
PORT=4000
|
|
NODE_ENV=production
|
|
|
|
# Conexión a MongoDB (Red interna de Coolify)
|
|
MONGODB_URI=mongodb://admin:AlmeiraTransporte2026Secure!@coolify-mongodb-cali:27017/transporte_cali_buenaventura?authSource=admin
|
|
|
|
# Appwrite Cloud Propio
|
|
APPWRITE_ENDPOINT=https://appwrite.almeira.com.co/v1
|
|
APPWRITE_PROJECT_ID=69b84df5003bd8957c5c
|
|
APPWRITE_DATABASE_ID=sneakers_multistore_db
|
|
APPWRITE_API_KEY=standard_cce3cdb866ea6433888d40cedd24dc45987372308fdc3dd0697de08648c0e5c7e04b02c3bcee271403fd656b00a5820f04c08b51631284a6e8a3582d8aed2aa33234f3c29cc777e9b162eb54810b789251b0d006a9a3b081ebc2da53b9baa94614b124b3508ad849fd9a4187cc6094f506d4b57f409b69d9562a74df594f3ec3
|
|
|
|
# WhatsApp Evolution API
|
|
EVOLUTION_API_URL=https://evolution.almeira.com.co
|
|
EVOLUTION_API_KEY=EE49029EEB85-4568-8F81-C9FDFC6E2943
|
|
EVOLUTION_INSTANCE=AutomataAlmeira
|
|
|
|
# Bold Smart Checkout (Producción)
|
|
BOLD_IDENTITY_KEY=k_live_a34f8902bc45de
|
|
BOLD_SECRET_KEY=s_live_902bc45de890a3
|
|
BOLD_INTEGRITY_KEY=i_live_bc45de890a34f8
|
|
```
|
|
|
|
5. **Despliegue y Webhook Automático (CI/CD)**:
|
|
- Hacer clic en **Deploy** para iniciar el primer despliegue.
|
|
- En los ajustes de la aplicación en Coolify, copiar la URL del **Webhook de Despliegue**.
|
|
- En Gitea (`https://gitea.almeira.com.co/carlos/almeira-web/settings/hooks`), agregar el Webhook para el evento `Push`. De esta forma, cada commit enviado al servidor Git desplegará automáticamente la versión más reciente.
|
|
|
|
---
|
|
|
|
## 3. URLs Disponibles una vez Desplegado
|
|
|
|
- **Página Web Principal**: `https://pacifictrans.almeira.com.co/`
|
|
- **Descarga Directa del APK Android**: `https://pacifictrans.almeira.com.co/PacifictransGo.apk`
|
|
- **API REST & Telemetría**: `https://pacifictrans.almeira.com.co/api/health`
|
|
- **Webhook Oficial de Pagos Bold**: `https://pacifictrans.almeira.com.co/api/payments/bold/webhook`
|