FROM python:3.11-slim

WORKDIR /app

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    curl \
    wget \
    && rm -rf /var/lib/apt/lists/*

# 安装 Hermes Agent（从 pip）
RUN pip install --no-cache-dir hermes-agent

# 复制配置文件（从 config 目录挂载）
# 注意：config.yaml 通过 volume 挂载，此处不 COPY

EXPOSE 8642

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
    CMD curl -f http://localhost:8642/health || exit 1

CMD ["hermes", "serve", "--config", "/app/config.yaml"]
