fix(docker): copy rest_provider.py into the image#23
Merged
Conversation
The Dockerfile copies modules by explicit name, and rest_provider.py was never added when the REST/OAuth feature merged. The published image has the frontend/server code that imports rest_provider but not the module itself, so /api/pending-auth (polled by the UI) and any REST provider fail at runtime with ModuleNotFoundError. - Add rest_provider.py to the COPY line and set MCPPROXY_REST_AUTH_DIR. - Add tests/test_dockerfile.py guarding that every local module imported by runtime code is COPYd into the image, so a new module can't silently break the build again. https://claude.ai/code/session_01L9uGbkXi2RwUmBQHdVaNoZ
There was a problem hiding this comment.
Pull request overview
This PR fixes a Docker image runtime failure where rest_provider.py was imported by the frontend/server but not included in the built image, and adds a regression test to prevent future missing-module COPY omissions.
Changes:
- Add
rest_provider.pyto the Dockerfile’s explicitCOPYlist. - Set
MCPPROXY_REST_AUTH_DIRin the Dockerfile to ensure a consistent in-container REST OAuth token cache location. - Add
tests/test_dockerfile.pyto assert that root-level local modules imported by runtime code are present in the Docker image COPY list (plus an explicit guard forrest_provider).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Dockerfile |
Copies rest_provider.py into the image and sets MCPPROXY_REST_AUTH_DIR env var. |
tests/test_dockerfile.py |
Adds a guard test ensuring runtime-imported root modules are included in the Dockerfile COPY list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The Dockerfile copies modules by explicit name, and rest_provider.py was never added when the REST/OAuth feature merged. The published image has the frontend/server code that imports rest_provider but not the module itself, so /api/pending-auth (polled by the UI) and any REST provider fail at runtime with ModuleNotFoundError.
https://claude.ai/code/session_01L9uGbkXi2RwUmBQHdVaNoZ