Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Dockerfile
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 link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unpinned uv version reduces reproducibility

Using uv:latest means that each Docker build may pull a different version of uv, 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).

Suggested change
# Install uv for fast dependency management
COPY --from=ghcr.io/astral-sh/uv:0.6.8 /uv /uvx /bin/

Check the uv releases page for the latest stable version to pin.

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"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 README documents a personal Docker Hub image

This docker run line directs users to pull ashayc/fli-mcp:latest, the same unverified personal image referenced in docker-compose.yml. Until an official image is published under the repository's namespace (e.g. ghcr.io/punitarani/fli-mcp), the documentation should only show the local-build workflow:

Suggested change
# Using Docker Compose (recommended)
# Or run directly with docker (after building locally)
docker run -d -p 8000:8000 fli-mcp

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):
Expand Down
21 changes: 21 additions & 0 deletions docker-compose.yml
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Personal Docker Hub image as default

The compose file defaults to pulling ashayc/fli-mcp:latest — a personal Docker Hub account belonging to the PR author, not the repository owner. Any user who runs docker compose up -d will silently pull from this unverified external image rather than building from the local source. This is both a supply-chain trust concern and a reliability risk (the image could be deleted or become stale at any time).

The safer default is to build from the local Dockerfile and document the pre-built image as an alternative option:

Suggested change
image: ashayc/fli-mcp:latest
# To build locally instead of using pre-built image, comment out 'image' and uncomment 'build':
build: .
# To use a pre-built image instead of building locally, comment out 'build' and uncomment 'image':
# image: ghcr.io/punitarani/fli-mcp:latest

A matching update to the README docker run example (line 376) should also drop the ashayc/fli-mcp:latest reference or replace it with the canonical registry path once one is established.

# 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