Repository navigation
Copy only what the server reads into the Docker runtime image - #2443
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The runtime image copied the whole repo from the build stage, including client source, tests, tooling configs, lockfiles, and
samples/. It now copies only what the entrypoint and server read.User-facing: none
Gone from
/graph-explorer, 1,077 files outsidenode_modules:src,public,index.html,package.json, and.browserslistrc. The server serves onlydist.*.test.tsfiles,test-setup.ts,testing.ts, andshared/src/utils/testing..dockerignorenow leaves tests and their helpers out of the build context, so a test-only edit no longer reruns the client build. No runtime module or client entry imports them.package.json,pnpm-lock.yaml,pnpm-workspace.yaml,.npmrc, and.node-version. Node reads"type"from the proxy server's and shared's ownpackage.json, and resolves through the existingnode_modulessymlinks.tsconfig*.json,vite.config.ts,skills-lock.json,Dockerfile, and the.git*and.docker*files.samples/: a contributor compose file.node_modulesis unchanged, with an identical listing. The Docker test build now also checks that/explorer/returns 200 in all three modes, since a missingdistis the likeliest way a trimmed copy breaks.Evidence
Before: 3,071 files under
/graph-exploreroutsidenode_modules.After: 1,994 files. The new UI check fails with
returned 404on an image withdist/index.htmlremoved, and passes on this image.Verified live: I built
mainand this branch and ran both side by side on Docker 29.5.2. Results were identical:docker inspect: same ports, entrypoint, workdir, user, and env.HOST, and a SageMaker-style run with--restart alwaysandNEPTUNE_NOTEBOOK=true. All answer/statusand serve the UI and its JS. Chrome loads the UI with no console errors.config.jsonmount (read-write and read-only) and aCONFIGURATION_FOLDER_PATHfolder give the same.env,defaultConnection.json, and/defaultConnection.cert-infoserve the same fingerprint, and a generated cert survivesdocker restart.docker stopexits 0 in about 0.13s.cert-infohashes the same. The client JS is identical apart from the CSS file name, and the CSS drops 4 unused classes Tailwind had generated from test strings, such as.blurfromfireEvent.blur.Merge Danger
Door: two-way
Impact: image contents
If the server reads a file at runtime that this list drops, the container fails at startup. The three-mode CI run and the checks above cover every startup path. Anyone who
docker execs into the container to read source or tests will no longer find them there.Related