Spaces:
Paused
Paused
File size: 1,976 Bytes
8dfbc29 a0fb44a 8dfbc29 46f4c81 8dfbc29 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | FROM nousresearch/hermes-agent:latest
# 1. Installation de Node.js, npm, git, ffmpeg et pnpm
USER root
RUN apt-get update && \
apt-get install -y nodejs npm git curl ffmpeg && \
npm install -g pnpm && \
rm -rf /var/lib/apt/lists/*
# 2. Installation de Hermes Workspace
RUN git clone https://github.com/NousResearch/hermes-workspace.git /opt/hermes-workspace
WORKDIR /opt/hermes-workspace
RUN pnpm install
# 3. Préparation du répertoire de données
RUN mkdir -p /opt/data/logs && chmod -R 777 /opt/data
# 4. Script d'initialisation au boot (nettoyage des verrous + permissions)
RUN mkdir -p /etc/cont-init.d && \
cat << 'EOF' > /etc/cont-init.d/99-fix-perms.sh
#!/bin/sh
rm -f /opt/data/*.lock /opt/data/*.db.init.lock
mkdir -p /opt/data/logs
chown -hR 10000:10000 /opt/data 2>/dev/null || true
chmod -R 777 /opt/data 2>/dev/null || true
EOF
RUN chmod +x /etc/cont-init.d/99-fix-perms.sh
# 5. Script de démarrage
RUN cat << 'EOF' > /usr/local/bin/start-hermes.sh
#!/bin/bash
set -e
echo "Starting Hermes Gateway..."
gateway run &
echo "Starting Hermes Workspace..."
cd /opt/hermes-workspace
pnpm dev
EOF
RUN chmod +x /usr/local/bin/start-hermes.sh
# 6. Configuration Gateway & Dashboard
ENV HERMES_HOME=/opt/data \
HOME=/opt/data \
HERMES_DASHBOARD=1 \
HERMES_DASHBOARD_HOST=0.0.0.0 \
HERMES_DASHBOARD_PORT=7860 \
API_SERVER_ENABLED=true \
API_SERVER_HOST=0.0.0.0 \
API_SERVER_PORT=8642
# 7. Activation des messageries
ENV TELEGRAM_ENABLED=true \
WHATSAPP_ENABLED=false \
DISCORD_ENABLED=false \
SLACK_ENABLED=false \
MATRIX_ENABLED=false
# Telegram
# ENV TELEGRAM_BOT_TOKEN="xxxxxxxx"
# ENV TELEGRAM_ALLOWED_USERS="xxxxxxxx"
# 8. Sécurité
ENV HERMES_TOOL_LOOP_HARD_STOP_ENABLED=true \
HERMES_TOOL_LOOP_EXACT_FAILURE_LIMIT=5 \
HERMES_TOOL_LOOP_IDEMPOTENT_LIMIT=5 \
HERMES_LOG_LEVEL=INFO
EXPOSE 7860
EXPOSE 8642
EXPOSE 3000
WORKDIR /opt/data
CMD ["/usr/local/bin/start-hermes.sh"] |