Skip to content

Commit 5c22af6

Browse files
committed
Fix Railway PORT expansion with entrypoint script
1 parent 28f5d35 commit 5c22af6

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Dockerfile.mcp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ RUN uv sync
2020

2121
# Set environment variables
2222
ENV ENVIRONMENT=production
23-
ENV PORT=8080
2423

2524
# Add virtual environment to PATH
2625
ENV PATH="/app/.venv/bin:$PATH"
2726

2827
# Expose port (Railway sets this dynamically)
2928
EXPOSE 8080
3029

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)))"]
30+
# Copy and use entrypoint script for proper PORT expansion
31+
COPY entrypoint.sh ./
32+
RUN chmod +x entrypoint.sh
33+
CMD ["./entrypoint.sh"]

entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
echo "Starting MCP HTTP server on port ${PORT:-8080}"
4+
exec python -m uvicorn rosetta.api.mcp_http:app --host 0.0.0.0 --port ${PORT:-8080}

0 commit comments

Comments
 (0)