# AgentHub — Déploiement Coolify MAINTENANT **Token API fourni :** ✅ **Projet Coolify :** Barodine IA (uuid: `x9fenmiro11hv1uqij88z88a`) **Environnement :** production (uuid: `ck47341a8lzae6x3mz8rd2cm`) --- ## Méthode recommandée : UI Coolify (5 min) ### Étape 1 : Se connecter à Coolify ``` URL: https://coolify.barodine.net ``` ### Étape 2 : Aller dans le projet "Barodine IA" 1. Dashboard → Projects → **Barodine IA** 2. Environnement : **production** ### Étape 3 : Créer une nouvelle ressource 1. Cliquer sur **+ New Resource** 2. Sélectionner **Docker Compose** ### Étape 4 : Configuration de la source **Option A : Via Git (si repo Forgejo existe)** - Type : **Git Repository** - URL : `https://forgejo.barodine.net/barodine/agenthub.git` (si configuré) - Branch : `main` - Path to compose : `compose.coolify.yml` **Option B : Via upload local (RECOMMANDÉ - plus rapide)** 1. Cliquer sur **Upload** ou **Local Folder** 2. Upload le tarball : `/tmp/agenthub-coolify.tar.gz` 3. Path to compose : `compose.coolify.yml` ### Étape 5 : Configurer les variables d'environnement Dans l'onglet **Environment Variables**, ajouter : ```bash # Copier depuis .env.coolify.secrets POSTGRES_PASSWORD= JWT_SECRET= # Variables fixes POSTGRES_USER=agenthub POSTGRES_DB=agenthub ALLOWED_ORIGINS=https://agenthub.barodine.net NODE_ENV=production LOG_LEVEL=info ``` **Fichier secrets :** `agenthub/.env.coolify.secrets` (chmod 600) ### Étape 6 : Configurer le domaine 1. Onglet **Domains** 2. Ajouter domaine : `agenthub.barodine.net` 3. ✅ Activer **HTTPS** (Let's Encrypt) 4. ✅ Activer **WebSocket Support** ### Étape 7 : Déployer 1. Cliquer sur **Deploy** 2. Suivre les logs en temps réel 3. Attendre que le build se termine (~3-5 min) ### Étape 8 : Vérification (PRIORITÉ CEO) ```bash # Healthcheck HTTP curl https://agenthub.barodine.net/healthz ``` **Réponse attendue :** ```json { "status": "ok", "uptime": 123.456 } ``` Si **200 OK** → ✅ **Déploiement réussi !** --- ## Étapes post-déploiement ### 1. Migrations de base de données Via Terminal Coolify (UI) : 1. Services → `app` → Terminal 2. Exécuter : ```bash npm run migrate ``` ### 2. Vérification complète Suivre le guide : `docs/POST-DEPLOY-VERIFICATION.md` Phases critiques : - ✅ Healthcheck HTTP - ✅ TLS certificate - ✅ Postgres connecté - ✅ Redis connecté - ✅ WebSocket fonctionnel --- ## Alternative : Déploiement via SSH direct (si accès serveur) Si vous avez accès SSH au serveur Coolify (`192.168.9.25`) : ```bash # 1. Copier le code sur le serveur scp /tmp/agenthub-coolify.tar.gz user@192.168.9.25:/tmp/ # 2. SSH au serveur ssh user@192.168.9.25 # 3. Extraire et déployer mkdir -p /opt/agenthub cd /opt/agenthub tar xzf /tmp/agenthub-coolify.tar.gz --strip-components=1 # 4. Configurer les variables d'environnement cat > .env < JWT_SECRET= POSTGRES_USER=agenthub POSTGRES_DB=agenthub ALLOWED_ORIGINS=https://agenthub.barodine.net NODE_ENV=production LOG_LEVEL=info EOF # 5. Déployer docker compose -f agenthub/compose.coolify.yml up -d --build # 6. Vérifier curl http://localhost:3000/healthz ``` --- ## Informations du déploiement **Projet Coolify :** - ID: 5 - UUID: `x9fenmiro11hv1uqij88z88a` - Nom: Barodine IA **Environnement :** - Nom: production - UUID: `ck47341a8lzae6x3mz8rd2cm` **Secrets générés :** - Fichier: `.env.coolify.secrets` (chmod 600) - Ne PAS committer ce fichier - Sauvegarder dans un gestionnaire de secrets si nécessaire **Code source :** - Tarball: `/tmp/agenthub-coolify.tar.gz` (250 KB) - Contient: Dockerfile, compose.coolify.yml, src/, scripts/, docs/ --- ## Priorité CEO **Objectif immédiat :** Healthcheck fonctionnel sur `https://agenthub.barodine.net/healthz` Dès que le healthcheck répond `200 OK`, le reste peut suivre progressivement : - Auth agents - Rooms - Messaging --- ## Support - Guide complet: `docs/DEPLOY-COOLIFY-QUICKSTART.md` - Vérification: `docs/POST-DEPLOY-VERIFICATION.md` - Script API: `scripts/deploy-coolify-api.sh` (si API Coolify fonctionne) **Token API Coolify fourni :** ✅ **Tout est prêt pour le déploiement !**