Add Dockerfile for Railway MCP server deployment

- Create custom Dockerfile to properly build and deploy MCP server
- Simplify railway.json to rely on Dockerfile configuration
- Ensure mcp_server directory and dependencies are correctly handled
- Set proper PYTHONPATH and port configuration for Railway

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Tyler Lafleur 2025-09-19 21:49:41 -05:00
parent a65f60b4a6
commit 5b5453e71e
2 changed files with 24 additions and 4 deletions

24
Dockerfile Normal file
View file

@ -0,0 +1,24 @@
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install uv for dependency management
RUN pip install uv
# Copy the entire project
COPY . .
# Install dependencies for the MCP server
WORKDIR /app/mcp_server
RUN uv sync
# Set environment variables
ENV PORT=8080
ENV PYTHONPATH=/app:/app/mcp_server
# Expose port for Railway
EXPOSE 8080
# Run the MCP server
CMD ["uv", "run", "graphiti_mcp_server.py", "--transport", "sse", "--host", "0.0.0.0", "--port", "8080"]

View file

@ -1,10 +1,6 @@
{ {
"$schema": "https://railway.app/railway.schema.json", "$schema": "https://railway.app/railway.schema.json",
"build": {
"buildCommand": "cd mcp_server && uv sync"
},
"deploy": { "deploy": {
"startCommand": "cd /app/mcp_server && uv run graphiti_mcp_server.py --transport sse --host 0.0.0.0 --port 8080",
"restartPolicyType": "on_failure", "restartPolicyType": "on_failure",
"restartPolicyMaxRetries": 10 "restartPolicyMaxRetries": 10
} }