wenyin commited on
Commit
faa5e28
·
verified ·
1 Parent(s): 768d401

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -3
Dockerfile CHANGED
@@ -4,7 +4,7 @@ USER root
4
 
5
  # 1. 基础依赖
6
  RUN apt-get update && apt-get install -y \
7
- ripgrep ffmpeg git lsof build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  # 2. 安装核心包
@@ -21,14 +21,16 @@ COPY config.yaml /home/user/.hermes/config.yaml
21
  # 4. 生成稳如泰山的启动脚本
22
  RUN { \
23
  echo '#!/bin/bash'; \
24
- echo 'echo "=> Updating hermes-web-ui to latest..."'; \
25
- echo 'npm install -g hermes-web-ui@latest 2>&1 | tail -5'; \
26
  echo 'sed -i "s/sk-666666/${GEMINI_API_KEY}/g" /home/user/.hermes/config.yaml'; \
27
  echo 'sed -i "s/nvapi-666666/${NVIDIA_API_KEY}/g" /home/user/.hermes/config.yaml'; \
28
  echo 'echo "=> Starting Hermes Gateway..."'; \
29
  echo 'hermes gateway run &'; \
30
  echo 'sleep 5'; \
31
  echo 'echo "=> Starting Hermes Web UI..."'; \
 
 
32
  echo 'hermes-web-ui start --host 0.0.0.0 --port 7860'; \
33
  echo 'echo "========= WEB UI SERVER LOG ========="'; \
34
  echo 'cat /home/user/.hermes-web-ui/server.log || echo "Warning: log file not generated."'; \
 
4
 
5
  # 1. 基础依赖
6
  RUN apt-get update && apt-get install -y \
7
+ ripgrep ffmpeg git lsof build-essential psmisc \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  # 2. 安装核心包
 
21
  # 4. 生成稳如泰山的启动脚本
22
  RUN { \
23
  echo '#!/bin/bash'; \
24
+ echo '# 后台更新,不阻塞启动'; \
25
+ echo 'npm install -g hermes-web-ui@latest > /tmp/npm-update.log 2>&1 &'; \
26
  echo 'sed -i "s/sk-666666/${GEMINI_API_KEY}/g" /home/user/.hermes/config.yaml'; \
27
  echo 'sed -i "s/nvapi-666666/${NVIDIA_API_KEY}/g" /home/user/.hermes/config.yaml'; \
28
  echo 'echo "=> Starting Hermes Gateway..."'; \
29
  echo 'hermes gateway run &'; \
30
  echo 'sleep 5'; \
31
  echo 'echo "=> Starting Hermes Web UI..."'; \
32
+ echo '# 确保 7860 没有残留占用'; \
33
+ echo 'fuser -k 7860/tcp 2>/dev/null || true'; \
34
  echo 'hermes-web-ui start --host 0.0.0.0 --port 7860'; \
35
  echo 'echo "========= WEB UI SERVER LOG ========="'; \
36
  echo 'cat /home/user/.hermes-web-ui/server.log || echo "Warning: log file not generated."'; \