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-<hash>.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.
This commit is contained in:
@@ -31,6 +31,12 @@ RUN npm install --prefer-offline --no-audit && \
|
|||||||
npm install --prefer-offline --no-audit && \
|
npm install --prefer-offline --no-audit && \
|
||||||
npm cache clean --force
|
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
|
# Hand ownership to hermes user, then install Python deps in a virtualenv
|
||||||
RUN chown -R hermes:hermes /opt/hermes
|
RUN chown -R hermes:hermes /opt/hermes
|
||||||
USER hermes
|
USER hermes
|
||||||
|
|||||||
Reference in New Issue
Block a user