fix: give the MCP service its own railway.json (it was building the backend Dockerfile)#320
Conversation
…r/Dockerfile The repo-root railway.json is backend-specific (dockerfilePath: backend/Dockerfile). Railway feeds it to both services by default, so the MCP service was building the backend image and running `uvicorn main:app` -- but mcp-server/ has no main.py, only server.py. Every MCP deploy since OpenCodeIntel#296 crashed at boot ("Could not import module main") and failed healthcheck, leaving the service frozen on a 2-month-old image. This adds a dedicated mcp-server/railway.json (build mcp-server/Dockerfile, healthcheck /health) so the two services stop sharing one backend-shaped config. Activation: set the MCP service's config-as-code path to mcp-server/railway.json in the Railway dashboard; the backend service keeps reading the repo-root railway.json.
|
@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 44 minutes and 34 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR introduces a Railway deployment configuration file for the MCP server, specifying Docker build context, healthcheck endpoint targeting ChangesRailway MCP Server Deployment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mcp-server/railway.json`:
- Around line 4-6: The railway.json currently uses an unsupported "buildContext"
key; remove that key and rely on supported fields ("builder" and
"dockerfilePath") instead, then ensure the Docker build uses the correct source
by either moving the Dockerfile/Docker build context so dockerfilePath points at
the desired root (e.g., place Dockerfile at repository root or adjust
dockerfilePath to the correct location) and/or update mcp-server/Dockerfile
COPY/ADD paths to be source-root-agnostic; check and update "builder" and
"dockerfilePath" in railway.json and the mcp-server/Dockerfile COPY/ADD lines to
guarantee the intended files are available during build.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 40d4e015-aed5-4402-9791-4839befaa7b1
📒 Files selected for processing (1)
mcp-server/railway.json
CodeRabbit flagged buildContext as unsupported. Confirmed against Railway's config schema: supported build keys are builder, watchPatterns, buildCommand, dockerfilePath, railpackVersion. buildContext was silently ignored. Railway sets the Docker build context via the service Root Directory, not a config key, so the MCP service must set Root Directory=mcp-server in the dashboard; with that, the context is mcp-server/ and the Dockerfile is auto-detected, so dockerfilePath is dropped too (a repo-root-relative path is wrong inside the restricted context). Keeps only supported keys + the deploy healthcheck block.
|
Addressed the Railway sets the Docker build context via the Root Directory service setting ("only pulls down files from that directory"), not a config key. So the build context comes from setting Root Directory = Corrected activation (dashboard, after merge), both required:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Problem
The MCP service (
mcp.opencodeintel.com) has been failing every deploy since #296 (~2 months) and is frozen on that stale image. Deploy logs show:repeated until all 11 healthcheck attempts fail with "service unavailable".
Root cause
There is a single repo-root
railway.jsonthat is backend-specific:Railway feeds this config to both services by default. The backend service reads it correctly. The MCP service inherits it and builds
backend/Dockerfile, whoseCMDisuvicorn main:app-- butmcp-server/has nomain.py, onlyserver.py. So uvicorn crashes at boot on every MCP deploy.The MCP code itself is fine:
mcp-server/server.pyreads$PORTviaconfig.pyand serves a public/healthroute. The only problem is which Dockerfile Railway builds for that service.Fix
Stop the two services from sharing one backend-shaped config. Add a dedicated
mcp-server/railway.jsonthat buildsmcp-server/Dockerfilewith its own/healthhealthcheck. The backend service keeps reading the repo-rootrailway.jsonunchanged (it was just restored in #319; not touching it).Deliberately not doing what Railway's auto-diagnosis suggested (stripping
dockerfilePathfrom the rootrailway.json) -- that would remove the backend's build + healthcheck config and risk re-breaking the service #319 just fixed.Activation (required, manual)
This file is inert until the MCP service is pointed at it. In the Railway dashboard:
MCP service (
marvelous-endurance) -> Settings -> Config-as-code file path ->mcp-server/railway.json, then redeploy. The backend service is left on the repo-rootrailway.json.Testing
mcp-server/Dockerfilerunspython server.py(not uvicorn main:app) and its healthcheck already uses${PORT:-8080}.server.pybinds$PORTand registers a public/healthroute.$PORT.Summary by CodeRabbit