Date : 08/01/2026 19:15 Statut : Complete
Le container yolo-api tournait en mode standby (sleep infinity) sans API exposee.
Une API FastAPI existait mais n'etait pas deployee.
Modification pour utiliser l'image ultralytics/ultralytics:latest comme base :
Fichier : /stock_8to/33800-stack/docker/yolo-api/Dockerfile
image: ultralytics/ultralytics:latest vers build: context9200:9200network: host pour le build (contourne probleme reseau Docker)Fichier : /stock_36to/data/33800-stack/docker/stacks/yolo-api/docker-compose.yml
cd /mnt/stock_36to/data/33800-stack/docker/stacks/yolo-api
docker compose down && docker compose up -d --build
Fichier : /etc/nginx/sites-available/yolo.33800.nowhere84.com.conf
# Health check
curl https://yolo.33800.nowhere84.com/health
# {"status":"ok","model":"yolov8n","ready":true}
# Detection d'objets
curl -X POST https://yolo.33800.nowhere84.com/detect \
-F "file=@image.jpg"
# {"success":true,"count":1,"detections":[{"class":"cat","confidence":0.90...}]}
| Endpoint | Methode | Description |
|---|---|---|
/ |
GET | Info service |
/health |
GET | Health check |
/detect |
POST | Detection objets -> JSON |
/detect/image |
POST | Detection -> Image annotee PNG |
/classes |
GET | Liste des 80 classes COCO |
| Propriete | Valeur |
|---|---|
| URL | https://yolo.33800.nowhere84.com |
| Port local | 192.168.1.12:9200 |
| Machine | prod-portainer |
| Modele | YOLOv8n (nano, rapide) |
| Classes | 80 (COCO dataset) |
Probleme reseau identifie : les containers Docker sur prod-portainer n'ont pas acces a Internet pendant les builds.
Solution : ajout network: host dans la section build du compose.