Configuration Docker Auto-Start/Stop
Vue d'ensemble
Le système d'auto-start/stop automatique est un proxy Node.js custom qui gère le démarrage/arrêt automatique des services Docker en fonction de l'activité. Il remplace l'ancien système Sablier.
Emplacement : /opt/docker-autostart/ Port : 8890 Configuration : /opt/docker-autostart/config.json Timeout d'inactivité : 1800 secondes (30 minutes) Services configurés : 22
Services configurés
Tableau récapitulatif
| Service | Nom | Compose Dir | Port Proxy | Mode | Thème | Conteneurs |
|---|---|---|---|---|---|---|
| solidarlink.srv759970.hstgr.cloud | SolidarLink | /opt/wordpress-solidarlink | 9003 | Dynamic | hacker-terminal | nginx-solidarlink, wordpress-solidarlink |
| tika.srv759970.hstgr.cloud | Tika API | /opt/tika-server | 9998 | Blocking | (none) | tika-server |
| clemence.srv759970.hstgr.cloud | Clémence Site | /opt/wordpress-clemence | 9002 | Dynamic | ghost | wordpress-clemence, nginx-clemence |
| dashboard.srv759970.hstgr.cloud | Support Dashboard | /opt/support-dashboard | 8501 | Dynamic | matrix | support-dashboard |
| sharepoint.srv759970.hstgr.cloud | SharePoint Dashboards | /opt/sharepoint-dashboards | 8502 | Dynamic | shuffle | sharepoint-dashboards |
| admin.cristina.srv759970.hstgr.cloud | Cristina Admin | /opt/cristina-backend | 1337 | Dynamic | ghost | cristina-strapi |
| whisper.srv759970.hstgr.cloud | Whisper API (faster-whisper) | /opt/whisper-faster | 8001 | Blocking | (none) | faster-whisper |
| whisperx.srv759970.hstgr.cloud | WhisperX API (with diarization) | /opt/whisperx | 8002 | Blocking | (none) | whisperx |
| memvid.srv759970.hstgr.cloud | MemVid RAG API | /opt/memvid | 8506 | Blocking | (none) | memvid-api |
| memvid-ui.srv759970.hstgr.cloud | MemVid UI | /opt/memvid | 8507 | Dynamic | matrix | memvid-ui |
| ragflow.srv759970.hstgr.cloud | RAGFlow | /opt/ragflow/docker | 9500 | Blocking | cyberpunk | ragflow-server, ragflow-mysql, ragflow-es-01, ragflow-redis, ragflow-minio |
| rag-anything.srv759970.hstgr.cloud | RAG-Anything | /opt/rag-anything | 9510 | Blocking | synthwave | rag-anything-api |
Détails des paramètres
1. Mode Dynamic vs Blocking
Dynamic Mode (défaut)
- Comportement : Affiche une page d'attente animée pendant le démarrage
- Utilisation : Sites web, dashboards, applications UI
- Services : SolidarLink, Clémence, Support Dashboard, SharePoint, Cristina, MemVid UI
- Thèmes disponibles :
matrix- Animation Matrix (pluie de caractères verts)ghost- Fantômes flottants avec effets de particuleshacker-terminal- Terminal de hacking avec commandes simuléesshuffle- Cartes qui se mélangent et se révèlentcyberpunk- Grille néon avec effet glitchsynthwave- Grille rétro années 80
Blocking Mode ("blocking": true)
- Comportement : Démarre le service AVANT de répondre à la requête (pas de page d'attente)
- Utilisation : APIs qui doivent répondre immédiatement
- Services : Tika API, Whisper API, WhisperX API, MemVid API, RAGFlow, RAG-Anything
- Avantage : Le client reçoit directement la réponse API (pas d'HTML intermédiaire)
2. Paramètres de configuration
port (global)
Port d'écoute du proxy auto-start. Nginx redirige vers ce port pour tous les services configurés. idleTimeout (global)
Durée d'inactivité (en secondes) avant arrêt automatique du service. Par défaut : 30 minutes. composeDir (par service)
Répertoire contenant le docker-compose.yml du service.
composeFile (optionnel)
Nom du fichier compose si différent de docker-compose.yml. Exemple : RAGFlow utilise docker-compose-full.yml.
proxyPort (par service)
Port du service Docker vers lequel le proxy redirige après démarrage.
containers (par service)
Liste des conteneurs Docker à surveiller pour détecter l'état du service.
Configuration Nginx
Chaque service configuré utilise un bloc upstream et proxy_pass dans Nginx :
upstream docker-autostart-solidarlink {
server 127.0.0.1:8890;
}
server {
listen 443 ssl http2;
server_name solidarlink.srv759970.hstgr.cloud;
location / {
proxy_pass http://docker-autostart-solidarlink;
proxy_set_header Host $host;
proxy_set_header X-Autostart-Target "solidarlink.srv759970.hstgr.cloud";
}
}
Le header X-Autostart-Target permet au proxy d'identifier quel service démarrer.
Commandes de gestion
Vérifier l'état du proxy
Redémarrer le proxy
Consulter les logs
Modifier la configuration
Tester un service
Synchronisation dynamique
Ce document peut être mis à jour automatiquement depuis la configuration serveur.
Script de mise à jour
Utiliser le script scripts/sync-autostart-config.sh pour synchroniser :
Ce script : 1. Récupère /opt/docker-autostart/config.json depuis le serveur 2. Génère automatiquement le tableau récapitulatif 3. Met à jour cette documentation 4. Commit les changements si nécessaire
Architecture technique
Internet → Nginx (443) → docker-autostart (8890) → Service Docker (port spécifique)
↓
X-Autostart-Target header
↓
1. Check service status
2. Start containers if stopped
3. Wait for healthcheck
4. Proxy request to service
Flux Dynamic Mode
- Requête arrive sur Nginx
- Nginx redirige vers docker-autostart:8890
- Proxy détecte service arrêté
- Renvoie immédiatement page d'attente HTML avec thème
- JavaScript dans la page poll
/statustoutes les 2 secondes - Démarre les conteneurs Docker en arrière-plan
- Quand healthcheck OK → JavaScript redirige vers le service
Flux Blocking Mode
- Requête arrive sur Nginx
- Nginx redirige vers docker-autostart:8890
- Proxy détecte service arrêté
- Démarre les conteneurs et ATTEND le healthcheck
- Une fois prêt → Proxy la requête vers le service
- Client reçoit directement la réponse API
Références
- Guide complet : GUIDE_DOCKER_AUTOSTART.md
- Code source :
/opt/docker-autostart/index.js - Systemd service :
/etc/systemd/system/docker-autostart.service - Inventory complet : server-configs/INVENTORY.md
Dernière synchronisation : 2025-10-21 Config serveur : /opt/docker-autostart/config.json Total services : 22 (incluant stack collaboration: Nextcloud, ONLYOFFICE, Rocket.Chat, Jitsi Meet)