Z User commited on
Commit
b200516
·
1 Parent(s): 946e383

fix: use --ignore-scripts for npm install to avoid prepare hook failure

Browse files

- npm install --ignore-scripts prevents 'prepare' script from running during install
- The prepare script tries 'npm run build' which needs esbuild (not yet installed)
- npm rebuild node-pty compiles the native module separately
- Added fallback semicolon to apt-get purge to prevent cascade failure

Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -27,9 +27,11 @@ RUN mkdir -p /usr/share/fonts/truetype/noto && \
27
  fc-cache -f
28
 
29
  # ── 2. Build hermes-web-ui (Vue SPA + Node.js BFF) ──
 
30
  RUN git clone --depth 1 https://github.com/EKKOLearnAI/hermes-web-ui.git /tmp/hermes-web-ui && \
31
  cd /tmp/hermes-web-ui && \
32
- npm install --quiet 2>&1 | tail -5 && \
 
33
  npm install --save-dev esbuild --quiet 2>&1 | tail -3 && \
34
  npm run build 2>&1 | tail -10 && \
35
  mkdir -p /app/dist && \
@@ -39,7 +41,8 @@ RUN git clone --depth 1 https://github.com/EKKOLearnAI/hermes-web-ui.git /tmp/he
39
  echo "WebUI build complete"
40
 
41
  # ── 3. Cleanup build tools (save ~300MB) ──
42
- RUN apt-get purge -y --auto-remove make g++ gnupg2 && rm -rf /var/lib/apt/lists/*
 
43
 
44
  # ── 4. App config ──
45
  RUN mkdir -p /root/.hermes/plugins/image_gen/pollinations
 
27
  fc-cache -f
28
 
29
  # ── 2. Build hermes-web-ui (Vue SPA + Node.js BFF) ──
30
+ # Use --ignore-scripts to skip 'prepare' (which tries npm run build without esbuild)
31
  RUN git clone --depth 1 https://github.com/EKKOLearnAI/hermes-web-ui.git /tmp/hermes-web-ui && \
32
  cd /tmp/hermes-web-ui && \
33
+ npm install --ignore-scripts --quiet 2>&1 | tail -5 && \
34
+ npm rebuild node-pty 2>&1 | tail -3 && \
35
  npm install --save-dev esbuild --quiet 2>&1 | tail -3 && \
36
  npm run build 2>&1 | tail -10 && \
37
  mkdir -p /app/dist && \
 
41
  echo "WebUI build complete"
42
 
43
  # ── 3. Cleanup build tools (save ~300MB) ──
44
+ RUN apt-get purge -y --auto-remove make g++ gnupg2 2>&1 | tail -3; \
45
+ rm -rf /var/lib/apt/lists/*
46
 
47
  # ── 4. App config ──
48
  RUN mkdir -p /root/.hermes/plugins/image_gen/pollinations