Skip to content

Commit 5db218b

Browse files
committed
fix(docker): copy all declared workspace package.json files; wire ENTRYPOINT to CLI
Two unrelated breakages that prevented the documented `docker build .` followed by `docker run docx-corpus <subcommand>` workflow from working for any user. 1. Workspaces: the COPY block only copied apps/cli/package.json, but the root package.json declares apps/cdx-filter and apps/site as workspaces too. bun install aborted with "Workspace not found" for both. Added the missing COPY lines so the image faithfully mirrors the project's declared workspaces. (Mirrors reality rather than stubbing them out - keeps the build container honest with the source repo.) 2. Entrypoint: README documents `docker run ... docx-corpus scrape --batch 100`, but the entrypoint was `tail -f /dev/null` which ignored args. Switched to ENTRYPOINT bun run /app/apps/cli/index.ts with CMD --help so the documented invocation works and no-args runs show usage. Verified the failing bun install step by replicating the Dockerfile's COPY+install sequence in a temp directory: 1809 packages installed cleanly. Verified the CLI's --help argument produces the documented usage output.
1 parent a2a1f5f commit 5db218b

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ RUN apt-get update && apt-get install -y python3 python3-venv curl --no-install-
88
&& curl -LsSf https://astral.sh/uv/install.sh | sh
99
ENV PATH="/root/.local/bin:$PATH"
1010

11-
# Copy package files for caching
11+
# Copy package files for caching. The set must match the workspaces array
12+
# in the root package.json, otherwise bun install fails on missing workspaces.
1213
COPY package.json bun.lock ./
1314
COPY packages/shared/package.json ./packages/shared/
1415
COPY packages/scraper/package.json ./packages/scraper/
1516
COPY packages/extractor/package.json ./packages/extractor/
1617
COPY packages/embedder/package.json ./packages/embedder/
18+
COPY apps/cdx-filter/package.json ./apps/cdx-filter/
1719
COPY apps/cli/package.json ./apps/cli/
20+
COPY apps/site/package.json ./apps/site/
1821

19-
# Install TS dependencies (strip devDeps biome/lefthook not needed in container)
22+
# Install TS dependencies (strip devDeps - biome/lefthook not needed in container)
2023
RUN python3 -c "import json; p=json.load(open('package.json')); p.pop('devDependencies',None); json.dump(p,open('package.json','w'),indent=2)"
2124
RUN bun install --ignore-scripts --no-frozen-lockfile
2225

@@ -40,4 +43,7 @@ COPY packages/ ./packages/
4043
COPY apps/cli/ ./apps/cli/
4144
COPY scripts/ ./scripts/
4245

43-
ENTRYPOINT ["tail", "-f", "/dev/null"]
46+
# Entrypoint matches the documented usage in README ("docker run ... <subcommand> [args]").
47+
# Invokes the CLI directly; `docker run docx-corpus` with no args shows `corpus --help`.
48+
ENTRYPOINT ["bun", "run", "/app/apps/cli/index.ts"]
49+
CMD ["--help"]

0 commit comments

Comments
 (0)