-
Notifications
You must be signed in to change notification settings - Fork 93
feat: add Docker support for running MCP server #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Production Dockerfile for Fli MCP Server | ||
| # Build: docker build -t fli-mcp . | ||
| # Run: docker run -d -p 8000:8000 fli-mcp | ||
| # | ||
| # Note: This is separate from .devcontainer/Dockerfile which is for development. | ||
| # The devcontainer includes dev tools (git, make, act) and dev dependencies, | ||
| # resulting in a larger image (~500MB+). This production Dockerfile creates a | ||
| # minimal image (~350MB) with only runtime dependencies needed to run the MCP server. | ||
|
|
||
| FROM python:3.10-slim | ||
|
|
||
| # Install uv for fast dependency management | ||
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy dependency files first for better layer caching | ||
| COPY pyproject.toml uv.lock README.md ./ | ||
|
|
||
| # Copy source code | ||
| COPY fli/ ./fli/ | ||
|
|
||
| # Install production dependencies only (no dev extras) | ||
| RUN uv sync --frozen --no-dev | ||
|
|
||
| # Add virtual environment to PATH | ||
| ENV PATH="/app/.venv/bin:$PATH" | ||
|
|
||
| # Configure server to bind to all interfaces | ||
| ENV HOST=0.0.0.0 | ||
| ENV PORT=8000 | ||
|
|
||
| # Expose the MCP HTTP server port | ||
| EXPOSE 8000 | ||
|
|
||
| # Run the MCP HTTP server | ||
| CMD ["fli-mcp-http"] | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -370,6 +370,22 @@ docker run --rm fli-dev make lint | |||||||
| docker run --rm fli-dev make test-all | ||||||||
| ``` | ||||||||
|
|
||||||||
| ### Running MCP Server with Docker | ||||||||
|
|
||||||||
| ```bash | ||||||||
| # Using Docker Compose (recommended) | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This
Suggested change
|
||||||||
| docker compose up -d | ||||||||
|
|
||||||||
| # Or run directly with docker | ||||||||
| docker run -d -p 8000:8000 ashayc/fli-mcp:latest | ||||||||
|
|
||||||||
| # Or build and run locally | ||||||||
| docker build -t fli-mcp . | ||||||||
| docker run -d -p 8000:8000 fli-mcp | ||||||||
| ``` | ||||||||
|
|
||||||||
| The MCP server will be available at `http://localhost:8000/mcp/` | ||||||||
|
|
||||||||
| ### Running CI Locally with act | ||||||||
|
|
||||||||
| To run GitHub Actions locally, install [act](https://github.com/nektos/act): | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||||||||
| # Docker Compose for Fli MCP Server | ||||||||||||
| # Usage: docker compose up -d | ||||||||||||
| # MCP endpoint: http://localhost:8000/mcp/ | ||||||||||||
|
|
||||||||||||
| services: | ||||||||||||
| fli-mcp: | ||||||||||||
| image: ashayc/fli-mcp:latest | ||||||||||||
| # To build locally instead of using pre-built image, comment out 'image' and uncomment 'build': | ||||||||||||
|
Comment on lines
+7
to
+8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The compose file defaults to pulling The safer default is to build from the local
Suggested change
A matching update to the README |
||||||||||||
| # build: . | ||||||||||||
| ports: | ||||||||||||
| - "8000:8000" | ||||||||||||
| environment: | ||||||||||||
| - HOST=0.0.0.0 | ||||||||||||
| - PORT=8000 | ||||||||||||
| # Optional MCP server configuration: | ||||||||||||
| # - FLI_MCP_DEFAULT_PASSENGERS=1 | ||||||||||||
| # - FLI_MCP_DEFAULT_CURRENCY=USD | ||||||||||||
| # - FLI_MCP_DEFAULT_CABIN_CLASS=ECONOMY | ||||||||||||
| # - FLI_MCP_DEFAULT_SORT_BY=CHEAPEST | ||||||||||||
| # - FLI_MCP_MAX_RESULTS=10 | ||||||||||||
| restart: unless-stopped | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uvversion reduces reproducibilityUsing
uv:latestmeans that each Docker build may pull a different version ofuv, which could silently change resolution behaviour or introduce breaking changes. The devcontainer Dockerfile has the same pattern, so this is consistent with the project's current style — but for a production image it is worth pinning to a specific release (e.g.uv:0.6.x).Check the uv releases page for the latest stable version to pin.