xpeditis2.0/PORTAINER_FIX_QUICK.md
David 6e3191b50e
All checks were successful
CI/CD Pipeline / Backend - Build, Test & Push (push) Successful in 5m45s
CI/CD Pipeline / Frontend - Build, Test & Push (push) Successful in 28m26s
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Deployment Summary (push) Successful in 1s
CI/CD Pipeline / Deploy to Portainer (push) Successful in 14s
CI/CD Pipeline / Discord Notification (Failure) (push) Has been skipped
CI/CD Pipeline / Discord Notification (Success) (push) Successful in 1s
fix ci/cd and docker
2025-11-20 00:12:01 +01:00

153 lines
4.2 KiB
Markdown

# ⚡ Fix Rapide Portainer - Images Ne Montent Pas
## 🎯 Diagnostic
**Images ARM64 existent dans le registry** (vérifié avec `docker manifest inspect`)
**CI/CD build correctement** les images multi-architecture
**Stack Portainer correctement configuré**
**Problème le plus probable** : **Registry credentials manquants**
---
## 🔧 Solution Rapide (5 minutes)
### Étape 1 : Login Docker sur le Serveur Portainer
```bash
# SSH sur votre serveur ARM64
ssh votre-serveur
# Login au registry Scaleway
docker login rg.fr-par.scw.cloud/weworkstudio
# Credentials :
Username: nologin
Password: [copier le token depuis https://console.scaleway.com/registry/namespaces]
```
### Étape 2 : Test Pull Manuel
```bash
# Tester que ça marche
docker pull rg.fr-par.scw.cloud/weworkstudio/xpeditis-backend:preprod
# Devrait afficher :
# preprod: Pulling from weworkstudio/xpeditis-backend
# ...
# Status: Downloaded newer image for rg.fr-par.scw.cloud/weworkstudio/xpeditis-backend:preprod
# Vérifier que c'est ARM64
docker image inspect rg.fr-par.scw.cloud/weworkstudio/xpeditis-backend:preprod | grep Architecture
# Devrait afficher : "Architecture": "arm64" ✅
```
### Étape 3 : Ajouter Registry dans Portainer (Interface Web)
1. **Portainer****Registries** (menu gauche)
2. **Add registry**
3. Remplir :
- **Name** : `Scaleway`
- **Registry URL** : `rg.fr-par.scw.cloud/weworkstudio`
- **Authentication** : ✅ Activer
- **Username** : `nologin`
- **Password** : `[token Scaleway]`
4. **Add registry**
### Étape 4 : Update le Stack Portainer
1. **Portainer****Stacks** → Votre stack Xpeditis
2. Click **Editor**
3. Copier tout le contenu de `docker/portainer-stack.yml` (avec `platform: linux/arm64` ajouté)
4.**Cocher "Re-pull image and redeploy"**
5. Click **Update the stack**
### Étape 5 : Vérifier les Logs
1. **Portainer****Containers**
2. Cliquer sur `xpeditis-backend`
3. **Logs**
**Logs attendus** :
```
✅ PostgreSQL is ready
🔄 Running database migrations...
✅ Successfully ran X migration(s)
✅ Database migrations completed
🚀 Starting NestJS application...
[Nest] Application is running on: http://0.0.0.0:4000
```
---
## 🚨 Si Docker Swarm Mode
Si vous utilisez Docker Swarm (présence de `deploy.placement.constraints` dans le stack), vous devez login sur **TOUS les nodes** :
```bash
# Sur chaque node du swarm
docker login rg.fr-par.scw.cloud/weworkstudio
```
Vérifier les nodes :
```bash
docker node ls
# Tous doivent être READY
```
---
## ⚙️ Modifications Appliquées au Stack
**Ajout de `platform: linux/arm64`** pour forcer la sélection ARM64 :
```yaml
xpeditis-backend:
image: rg.fr-par.scw.cloud/weworkstudio/xpeditis-backend:preprod
platform: linux/arm64 # ← AJOUTÉ
restart: unless-stopped
# ...
xpeditis-frontend:
image: rg.fr-par.scw.cloud/weworkstudio/xpeditis-frontend:preprod
platform: linux/arm64 # ← AJOUTÉ
restart: unless-stopped
# ...
```
**Pourquoi ?** : Garantit que Docker pull l'image ARM64 et non AMD64.
---
## 📊 Checklist Rapide
- [ ] SSH sur serveur Portainer
- [ ] `docker login rg.fr-par.scw.cloud/weworkstudio`
- [ ] Test : `docker pull rg.fr-par.scw.cloud/weworkstudio/xpeditis-backend:preprod`
- [ ] Ajouter registry dans Portainer (Registries → Add registry)
- [ ] Copier le nouveau `portainer-stack.yml` (avec `platform: linux/arm64`)
- [ ] Update stack avec "Re-pull image and redeploy"
- [ ] Vérifier logs : `✅ Database migrations completed` puis `🚀 Starting NestJS application...`
- [ ] Tester API : `curl https://api.preprod.xpeditis.com/api/v1/health`
- [ ] Tester frontend : `https://app.preprod.xpeditis.com`
---
## 🎯 Résumé du Problème
| Composant | Status |
|-----------|--------|
| Images ARM64 dans registry | ✅ OK |
| CI/CD build multi-arch | ✅ OK |
| Stack configuration | ✅ OK |
| **Registry credentials** | ❌ **MANQUANTS** |
**Solution** : Ajouter credentials Scaleway dans Portainer + forcer `platform: linux/arm64`
---
**ETA Fix** : 5 minutes
**Impact** : 🔴 Critique - Bloque déploiement
**Difficulté** : ⚡ Facile - Configuration uniquement