Skip to content

Commit 28f5d35

Browse files
committed
Fix PORT env var by reading in Python instead of shell expansion
1 parent 3e94d5c commit 28f5d35

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Dockerfile.mcp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ ENV PATH="/app/.venv/bin:$PATH"
2828
# Expose port (Railway sets this dynamically)
2929
EXPOSE 8080
3030

31-
# Run the MCP HTTP server directly using the venv python
32-
CMD sh -c 'python -m uvicorn rosetta.api.mcp_http:app --host 0.0.0.0 --port ${PORT:-8080}'
31+
# Run the MCP HTTP server - use Python to run the module which reads PORT from env
32+
CMD ["python", "-c", "import os; import uvicorn; uvicorn.run('rosetta.api.mcp_http:app', host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))"]

src/rosetta/api/mcp_http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,5 +327,6 @@ async def mcp_options():
327327

328328
if __name__ == "__main__":
329329
import uvicorn
330-
port = int(os.getenv("PORT", 8001))
330+
port = int(os.getenv("PORT", "8080"))
331+
logger.info(f"Starting MCP HTTP server on port {port}")
331332
uvicorn.run(app, host="0.0.0.0", port=port)

0 commit comments

Comments
 (0)