FROM nousresearch/hermes-agent:latest USER root # 1. Dépendances minimales RUN apt-get update && \ apt-get install -y nodejs npm ffmpeg bash && \ rm -rf /var/lib/apt/lists/* # 2. Création des dossiers et permissions complètes pour l'utilisateur 1000 (Hugging Face) RUN mkdir -p /opt/data/logs /opt/data/.hermes && \ chown -R 1000:1000 /opt/data && \ chmod -R 777 /opt/data # 3. Lancement direct du binaire Hermes (Bypass total de s6-overlay et execline) RUN cat << 'EOF' > /opt/start.sh #!/bin/bash set -e # Export des chemins système export PATH="/command:/package/admin/s6-overlay/bin:/opt/hermes/bin:/usr/local/bin:${PATH}" echo "🚀 Démarrage d'Hermes Agent (Mode Direct Native pour Hugging Face)..." # Détection et exécution directe de la CLI Hermes avec les arguments (gateway) if command -v hermes >/dev/null 2>&1; then exec hermes "$@" elif [ -f /opt/hermes/bin/hermes ]; then exec /opt/hermes/bin/hermes "$@" else exec python3 -m hermes "$@" fi EOF RUN chmod +x /opt/start.sh # 4. Variables d'environnement Hermes ENV HERMES_HOME=/opt/data \ HOME=/opt/data \ API_SERVER_ENABLED=true \ API_SERVER_HOST=0.0.0.0 \ API_SERVER_PORT=8642 \ HERMES_DASHBOARD=1 \ HERMES_DASHBOARD_HOST=0.0.0.0 \ HERMES_DASHBOARD_PORT=7860 \ API_SERVER_KEY=hermes_2026_8QvL9mN2XpR7kTw5YcH4ZaU1EfD8JsP6BgW3NrKyLxV9 \ TELEGRAM_ENABLED=false EXPOSE 7860 8642 WORKDIR /opt/data # 5. Passage obligatoire à l'utilisateur 1000 pour Hugging Face Spaces USER 1000 # 6. Point d'entrée sécurisé et commande gateway ENTRYPOINT ["/opt/start.sh"] CMD ["gateway"]