From b0bde98b0fb17c0015481e2f38b655f0a07558fa Mon Sep 17 00:00:00 2001 From: bluefishs <125471205+bluefishs@users.noreply.github.com> Date: Sun, 19 Apr 2026 00:50:24 +0800 Subject: [PATCH] fix(docker): build web/ dashboard assets in image (#12180) The Dockerfile installs root-level npm dependencies (for Playwright) and the whatsapp-bridge bundle, but never builds the web/ Vite project. As a result, 'hermes dashboard' starts FastAPI on :9119 but serves a broken SPA because hermes_cli/web_dist/ is empty and requests to /assets/index-.js 404. Add a build step inside web/ so the Vite output is baked into the image. Reproduce (before): docker build -t hermes-repro -f Dockerfile . docker run --rm -p 9119:9119 hermes-repro hermes dashboard curl -sI http://localhost:9119/assets/ | head -1 # -> 404 After: /assets/ returns the built asset path. --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 37038233..4f88a303 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,12 @@ RUN npm install --prefer-offline --no-audit && \ npm install --prefer-offline --no-audit && \ npm cache clean --force +# Build the web/ dashboard so FastAPI at :9119 can serve the Vite assets +RUN cd /opt/hermes/web && \ + npm install --prefer-offline --no-audit && \ + npm run build && \ + npm cache clean --force + # Hand ownership to hermes user, then install Python deps in a virtualenv RUN chown -R hermes:hermes /opt/hermes USER hermes