diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..690f602 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 6d653ff..383bdd5 100644 --- a/README.md +++ b/README.md @@ -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) +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): diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ee9d8f6 --- /dev/null +++ b/docker-compose.yml @@ -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': + # 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