mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
fix(docker): prebuild TUI assets in image
This commit is contained in:
@@ -30,18 +30,22 @@ WORKDIR /opt/hermes
|
|||||||
# unless the lockfiles themselves change.
|
# unless the lockfiles themselves change.
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
COPY web/package.json web/package-lock.json web/
|
COPY web/package.json web/package-lock.json web/
|
||||||
|
COPY ui-tui/package.json ui-tui/package-lock.json ui-tui/
|
||||||
|
COPY ui-tui/packages/hermes-ink/package.json ui-tui/packages/hermes-ink/
|
||||||
|
|
||||||
RUN npm install --prefer-offline --no-audit && \
|
RUN npm install --prefer-offline --no-audit && \
|
||||||
npx playwright install --with-deps chromium --only-shell && \
|
npx playwright install --with-deps chromium --only-shell && \
|
||||||
(cd web && npm install --prefer-offline --no-audit) && \
|
(cd web && npm install --prefer-offline --no-audit) && \
|
||||||
|
(cd ui-tui && npm install --prefer-offline --no-audit) && \
|
||||||
npm cache clean --force
|
npm cache clean --force
|
||||||
|
|
||||||
# ---------- Source code ----------
|
# ---------- Source code ----------
|
||||||
# .dockerignore excludes node_modules, so the installs above survive.
|
# .dockerignore excludes node_modules, so the installs above survive.
|
||||||
COPY --chown=hermes:hermes . .
|
COPY --chown=hermes:hermes . .
|
||||||
|
|
||||||
# Build web dashboard (Vite outputs to hermes_cli/web_dist/)
|
# Build browser dashboard and terminal UI assets.
|
||||||
RUN cd web && npm run build
|
RUN cd web && npm run build && \
|
||||||
|
cd ../ui-tui && npm run build
|
||||||
|
|
||||||
# ---------- Permissions ----------
|
# ---------- Permissions ----------
|
||||||
# Make install dir world-readable so any HERMES_UID can read it at runtime.
|
# Make install dir world-readable so any HERMES_UID can read it at runtime.
|
||||||
|
|||||||
@@ -76,3 +76,12 @@ def test_dockerfile_entrypoint_routes_through_the_init(dockerfile_text):
|
|||||||
"If tini is only installed but not wired into ENTRYPOINT, hermes "
|
"If tini is only installed but not wired into ENTRYPOINT, hermes "
|
||||||
"still runs as PID 1 and zombies will accumulate (#15012)."
|
"still runs as PID 1 and zombies will accumulate (#15012)."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_dockerfile_installs_tui_dependencies(dockerfile_text):
|
||||||
|
assert "ui-tui/package.json" in dockerfile_text
|
||||||
|
assert "cd ui-tui && npm install" in dockerfile_text
|
||||||
|
|
||||||
|
|
||||||
|
def test_dockerfile_builds_tui_assets(dockerfile_text):
|
||||||
|
assert "cd ../ui-tui && npm run build" in dockerfile_text
|
||||||
|
|||||||
Reference in New Issue
Block a user