diff --git a/CLAUDE.md b/CLAUDE.md index f0db4e7..3a13add 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -71,6 +71,8 @@ docs/ architecture notes, ADRs, API specs - **Never run two `docker compose up --build` at once** — both grab the same `--mount=type=cache,id=pnpm` and deadlock on the API's `pnpm --prod deploy` step. Symptom: build sits silent for hours on `[api builder 8/8]`. Before starting any build, check `ps aux | grep "docker compose"` and kill any prior `up --build` (`kill -9 ` — the wrapper bash and the docker compose binary are separate PIDs; kill the docker compose one). - **Don't add `--offline` to `pnpm --prod deploy`** — pnpm's metadata cache (`/root/.cache/pnpm/`) is not in the `/pnpm/store` cache mount, so `--offline` fails with `ERR_PNPM_NO_OFFLINE_META` for transitive devDeps (e.g. vite via vitest). Leave the deploy step network-on; it works. - **All TS Dockerfiles need `python3 make g++`** in the base stage — `better-sqlite3` rebuilds natively on install. Missing from `Dockerfile.admin` historically caused `gyp ERR! find Python` failures. + - **`Dockerfile.ml` needs `build-essential`** (not just `gcc`) — `pyswisseph` (stars agent) compiles C from source and fails with `fatal error: math.h: No such file or directory` if only `gcc` is installed; it needs `libc-dev` too, easiest via `build-essential`. + - **`Dockerfile.web` builder stage needs root `package.json` + `pnpm-workspace.yaml` + `pnpm-lock.yaml`** copied in. Without them, `pnpm --filter @oo/shared-types build` fails with `[ERR_PNPM_NO_PKG_MANIFEST] No package.json found in /app`. The deps stage has them but the builder is a fresh layer; selective copies must include them. - **A clean build of `--profile core` takes ~3 min total** when the buildx cache is warm. If it's been silent for >10 min, check for the parallel-build deadlock above before assuming "still going". - Run Python agent tests: `python3 -m pytest ml/agents/tests/ -x -q` (tests add repo root to `sys.path` themselves). - Run Python feature tests: `python3 -m pytest ml/features/ -x -q` diff --git a/infra/docker/Dockerfile.ml b/infra/docker/Dockerfile.ml index 1e33347..b66495c 100644 --- a/infra/docker/Dockerfile.ml +++ b/infra/docker/Dockerfile.ml @@ -1,5 +1,8 @@ FROM python:3.12-slim WORKDIR /app/ml/serving +RUN apt-get update \ + && apt-get install -y --no-install-recommends build-essential \ + && rm -rf /var/lib/apt/lists/* COPY ml/serving/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY ml/ /app/ml/ diff --git a/infra/docker/Dockerfile.web b/infra/docker/Dockerfile.web index 8602a62..074a4d6 100644 --- a/infra/docker/Dockerfile.web +++ b/infra/docker/Dockerfile.web @@ -13,6 +13,7 @@ WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/packages/shared-types/node_modules ./packages/shared-types/node_modules COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules +COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./ COPY tsconfig.base.json ./ COPY packages/shared-types ./packages/shared-types COPY apps/web ./apps/web