fix(mana-ai): copy missing workspace deps into Docker installer stage

The Dockerfile copied only @mana/shared-{hono,ai,logger}, but
services/mana-ai/package.json also depends on @mana/shared-research and
@mana/tool-registry (and @mana/tool-registry pulls in
@mana/shared-crypto transitively). Without those, pnpm couldn't
resolve the workspace symlinks and the container crashlooped on every
restart with:

  error: ENOENT reading "/app/services/mana-ai/node_modules/@mana/tool-registry"

Surfaced today after a manual `gh workflow run cd-macmini.yml -f
service=mana-ai` — mana-ai had never been deployed because no commit
since the CD pipeline started had touched its path. The first real
deploy hit the missing-COPY immediately.

Header comment in the Dockerfile now spells out direct + transitive
workspace deps so future additions don't drift.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-28 15:42:20 +02:00
parent 9a0cf5b676
commit 34b1690ea4

View file

@ -5,12 +5,22 @@ RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
WORKDIR /app
# Copy workspace structure
# Copy workspace structure. Every workspace dep referenced (transitively
# included) by services/mana-ai/package.json must be present here, or
# pnpm leaves the symlink broken and the container crashloops with
# "ENOENT reading /app/services/mana-ai/node_modules/@mana/<pkg>".
#
# Direct deps: @mana/shared-{ai,hono,research}, @mana/tool-registry
# Transitive deps: @mana/shared-logger (via shared-hono),
# @mana/shared-crypto (via tool-registry)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY services/mana-ai/package.json ./services/mana-ai/
COPY packages/shared-hono ./packages/shared-hono
COPY packages/shared-ai ./packages/shared-ai
COPY packages/shared-logger ./packages/shared-logger
COPY packages/shared-research ./packages/shared-research
COPY packages/mana-tool-registry ./packages/mana-tool-registry
COPY packages/shared-crypto ./packages/shared-crypto
# Install only mana-ai and its workspace deps
RUN pnpm install --filter @mana/ai-service... --no-frozen-lockfile --ignore-scripts