mirror of
https://github.com/Significant-Gravitas/AgentProbe.git
synced 2026-11-10 04:41:46 -10:00
## Intent Slim the Docker runtime image for SYM-30 by replacing the runtime-stage full-tree copy with a production dependency install and explicit runtime asset copies. This removes tests, docs, scripts, agent metadata, and dev dependencies from the final image while preserving the Bun TypeScript server entrypoint, runtime data, and built dashboard bundle. ## Behavior changes No CLI or API behavior changes. The published Docker image contents are narrower: - Runtime stage now runs `bun install --production --frozen-lockfile`. - Final image copies only `src`, `data`, and `dashboard/dist` from the build stage. - `.dockerignore` excludes docs, scripts, tests, and agent metadata from the build context. Image evidence: - Before: `126398737` bytes; `/app` was `191M`. - After: `71911094` bytes; `/app` is `15M`. - Reduction: `54487643` bytes, about 43.1%. - Final image inspection confirms `tests`, `dashboard/src`, `docs`, `scripts`, `.git`, `.agents`, `.claude`, `node_modules/@biomejs`, `node_modules/typescript`, `node_modules/bun-types`, and `node_modules/@types` are absent. ## Validation - [ ] `./scripts/fast-feedback.sh` passed - Not used as the final authority because its `bun run test` step hits existing 5s e2e timeout failures in this workspace; filed SYM-40. - [x] Behavior docs updated (if behavior changed) - No product behavior docs changed; Docker packaging only. Validation run: - `docker build -t agentprobe:sym-30-before .` on the original `origin/dev` Dockerfile for reproduction. - `docker run --rm --entrypoint sh agentprobe:sym-30-before -c '...'` confirmed broad runtime tree and dev deps present. - `docker build -t agentprobe:sym-30-after .` - `docker run --rm --entrypoint sh agentprobe:sym-30-after -c '...'` confirmed excluded paths/dev deps absent and runtime paths present. - `bun run docs:validate` passed. - `bun run test` failed only on existing 5s e2e timeouts; see SYM-40. - `bun run test:e2e` reproduced the same 5s e2e timeout failures; see SYM-40. - `bun test --timeout 30000 tests/e2e` passed: 20 pass, 0 fail. - `bun run test tests/integration/server` passed: 8 pass, 0 fail. - `bun run lint` passed. - `bun run typecheck` passed. - `bun run dashboard:build` passed. - `AGENTPROBE_SERVER_TOKEN=sym30-test-token OPEN_ROUTER_API_KEY=dummy-key docker compose -p sym30 up --build -d` passed. - Compose smoke: `/healthz` returned 200, authenticated `/api/presets` returned 200, authenticated dry-run `/api/runs` completed with `passed: true` and `exitCode: 0`. - `docker compose -p sym30 down -v` cleaned up the stack. ## Screenshots / video N/A for CLI-only changes.
33 lines
906 B
Docker
33 lines
906 B
Docker
FROM oven/bun:1.3.12 AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json bun.lock bunfig.toml ./
|
|
COPY dashboard/package.json dashboard/package.json
|
|
RUN bun install --frozen-lockfile
|
|
|
|
COPY . .
|
|
RUN bun run dashboard:build
|
|
|
|
FROM oven/bun:1.3.12-slim AS runtime
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production \
|
|
AGENTPROBE_SERVER_DATA=/app/data \
|
|
AGENTPROBE_SERVER_DB=/app/.agentprobe/runs.sqlite3 \
|
|
AGENTPROBE_SERVER_DASHBOARD_DIST=/app/dashboard/dist \
|
|
AGENTPROBE_SERVER_LOG_FORMAT=json
|
|
|
|
COPY --from=build /app/package.json /app/bun.lock ./
|
|
COPY --from=build /app/dashboard/package.json ./dashboard/package.json
|
|
RUN bun install --production --frozen-lockfile
|
|
|
|
COPY --from=build /app/src ./src
|
|
COPY --from=build /app/data ./data
|
|
COPY --from=build /app/dashboard/dist ./dashboard/dist
|
|
|
|
EXPOSE 7878
|
|
|
|
CMD ["bun", "run", "./src/cli/main.ts", "start-server", "--host", "0.0.0.0", "--port", "7878", "--unsafe-expose"]
|