Skip to content

perf: slim edge image, scope dockerignore, Node 22 and CI limits - #4

Merged
Sebas1705 merged 1 commit into
mainfrom
perf/docker-ci-phase1
Nov 12, 2026
Merged

Sebas1705 merged 1 commit into
mainfrom
perf/docker-ci-phase1

Conversation

@Sebas1705

Copy link
Copy Markdown
Contributor

Phase 1 image/CI optimizations (items 2, 3, 6, 7 of the AxiomNode review).

Changes

  • src/Dockerfile.edge: merged the deps and build stages, build the SDK once and npm prune --omit=dev it, then run npm prune --omit=dev for the gateway and install a single real copy of the pruned SDK in node_modules. The separate /workspace/shared-sdk-client copy in the runtime stage is gone, and COPY --chown replaces the layer-duplicating chown -R. (npm prune re-creates the file: SDK link, which does not resolve inside the image, so the copy is restored after the prune.)
  • src/Dockerfile.edge.dockerignore (new): CI builds from the workspace root, so src/.dockerignore is never read. This file is named after the Dockerfile so BuildKit uses it; patterns are relative to the context root and exclude .git, .env* (keeping .env.example), node_modules, dist, coverage, tests, docs. The existing src/.dockerignore is kept for builds whose context is src/.
  • Node 20 -> 22 in src/Dockerfile, src/Dockerfile.edge and ci.yml. No engines field exists in this repo. @fastify/cors is already ^11 here.
  • Workflows: concurrency (cancel-in-progress only for pull_request) and timeout-minutes on every job of ci.yml and security.yml. There is no docker/build-push-action in this repo and no trigger that can never build, so those two sub-items do not apply.

Verified locally

  • docker build -f src/Dockerfile.edge from a workspace-root context (api-gateway + shared-sdk-client + contracts-and-schemas): image 1.0 GB -> 411 MB; no tsc/vitest/eslint binaries in the runtime node_modules; container starts ("Gateway started"); build context dropped to a few kB.
  • npm ci, npm run build, npm test (112 passed), npm run lint on Node 24 (Node 22 only inside Docker, where tsc builds fine).
  • src/Dockerfile (non-edge) builds with Node 22.

Not verified

  • GitHub Actions changes (concurrency/timeouts/Node 22 in setup-node) were not run; they will be exercised by this PR's checks.
  • The platform-infra build-push workflow itself was not run.
  • Not touched: item 8 docs (README/AGENTS still mention automatic rollout) and npm install -> npm ci, left for a separate PR.

Overlap

Open PR #3 in this repo may touch workflow/Dockerfile files; I did not check it line by line, so expect possible trivial conflicts in ci.yml or src/Dockerfile*.

@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Sebas1705
Sebas1705 merged commit b624d52 into main Nov 12, 2026
6 checks passed
@Sebas1705
Sebas1705 deleted the perf/docker-ci-phase1 branch November 12, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant