-
Notifications
You must be signed in to change notification settings - Fork 23
Add Docker support for containerized deployments #49
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
Conversation
- Add Dockerfile with Python 3.12 slim base image - Install dependencies using uv for faster builds - Create docker-compose.yml for easy setup with Meilisearch - Add .dockerignore to exclude unnecessary files - Add Docker integration tests - Update README with Docker usage instructions - Support for n8n and other containerized environments Fixes #47
|
Warning Rate limit exceeded@tpayet has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 44 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
""" WalkthroughA Docker-based deployment setup for the Meilisearch MCP server is introduced. This includes a Dockerfile, docker-compose configuration, Docker ignore rules, integration tests for the Docker environment, and updated documentation providing usage instructions for containerized workflows, particularly for n8n integration. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Docker Compose
participant Meilisearch MCP Container
participant Meilisearch Container
User->>Docker Compose: docker-compose up
Docker Compose->>Meilisearch Container: Start Meilisearch
Docker Compose->>Meilisearch MCP Container: Build & start MCP server
Meilisearch MCP Container->>Meilisearch Container: Connect via MEILI_HTTP_ADDR
Meilisearch Container-->>Meilisearch MCP Container: Respond to health checks/requests
User->>Meilisearch MCP Container: Access MCP server (e.g., via n8n)
Assessment against linked issues
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
🧹 Nitpick comments (2)
docker-compose.yml (1)
1-31: Fix missing newline at end of file.The Docker Compose configuration is well-structured with proper service orchestration, networking, and environment variable setup. However, there's a formatting issue that should be addressed.
networks: meilisearch-network: driver: bridge +tests/test_docker_integration.py (1)
7-7: Remove unused import.The
osmodule is imported but never used in this file.-import os import subprocess
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.dockerignore(1 hunks)Dockerfile(1 hunks)README.md(1 hunks)docker-compose.yml(1 hunks)tests/test_docker_integration.py(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
docker-compose.yml
[error] 31-31: no new line character at the end of file
(new-line-at-end-of-file)
🪛 Ruff (0.11.9)
tests/test_docker_integration.py
7-7: os imported but unused
Remove unused import: os
(F401)
🪛 GitHub Actions: Test and Lint
tests/test_docker_integration.py
[error] 33-33: FileNotFoundError: 'docker-compose' command not found. The test setup failed when trying to run 'docker-compose up -d'.
[error] 33-33: FileNotFoundError: 'docker-compose' command not found. The test setup failed when trying to run 'docker-compose up -d'.
[error] 33-33: FileNotFoundError: 'docker-compose' command not found. The test setup failed when trying to run 'docker-compose up -d'.
🔇 Additional comments (4)
README.md (1)
140-164: Excellent Docker documentation section!The Docker usage instructions are comprehensive and well-structured, covering multiple deployment scenarios including n8n integration. The examples align well with the provided Docker configuration files.
Dockerfile (1)
1-28: Well-structured Dockerfile with modern practices!The Dockerfile follows Docker best practices:
- Uses slim base image for smaller size
- Installs minimal system dependencies
- Leverages uv for faster package management
- Sets appropriate default environment variables
- Uses proper module execution syntax
The implementation looks solid and production-ready.
.dockerignore (1)
1-69: Comprehensive and well-organized .dockerignore file!The exclusion list is thorough and covers all the necessary categories:
- Python cache and build artifacts
- Development environments and IDE files
- CI/CD and documentation files
- System-specific files
This will effectively optimize the Docker build context size and security.
tests/test_docker_integration.py (1)
62-69: I’d like to verify the exact Dockerfile commands to ensure dependencies are actually installed. Let’s dump the relevant sections:#!/bin/bash set -e echo ">>> Dockerfile: lines 1–30 <<<" sed -n '1,30p' Dockerfile || echo "Could not read Dockerfile" echo echo ">>> Dockerfile: lines 31–60 <<<" sed -n '31,60p' Dockerfile || echo "Could not read Dockerfile"
- Update publish.yml workflow to build and push Docker images on release - Add multi-platform support (linux/amd64 and linux/arm64) - Update README with Docker Hub installation instructions - Update docker-compose.yml to use Docker Hub image by default - Images will be tagged with version number and 'latest'
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.
Actionable comments posted: 0
🧹 Nitpick comments (5)
docker-compose.yml (3)
1-2: Specify Docker Compose file version
It's recommended to include a top-levelversion: '3.9'(or the appropriate schema version) to ensure clarity and compatibility across Compose implementations.
15-17: Avoid using thelatesttag for image
Pin themeilisearch/meilisearch-mcpimage to a specific version (e.g.,vX.Y.Z) for reproducible builds and to prevent unexpected changes when upstream publishes new tags.
33-33: Add newline at end of file
Ensure the file ends with a newline to satisfy POSIX conventions and remove the YAMLlint warning..github/workflows/publish.yml (2)
63-66: Remove trailing spaces
Multiple lines contain trailing whitespace, causing YAMLlint errors. Please strip the trailing spaces on these lines to improve readability and pass lint checks.Also applies to: 69-72, 78-87
97-97: Add newline at end of file
The workflow file should end with a newline to comply with standard file formatting and silence the linter.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/publish.yml(3 hunks)README.md(1 hunks)docker-compose.yml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/publish.yml
65-65: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
.github/workflows/publish.yml
[error] 63-63: trailing spaces
(trailing-spaces)
[error] 66-66: trailing spaces
(trailing-spaces)
[error] 69-69: trailing spaces
(trailing-spaces)
[error] 72-72: trailing spaces
(trailing-spaces)
[error] 78-78: trailing spaces
(trailing-spaces)
[error] 87-87: trailing spaces
(trailing-spaces)
[error] 97-97: no new line character at the end of file
(new-line-at-end-of-file)
[error] 97-97: trailing spaces
(trailing-spaces)
docker-compose.yml
[error] 33-33: no new line character at the end of file
(new-line-at-end-of-file)
- Replace legacy 'docker-compose' with 'docker compose' (no hyphen) - Ensures compatibility with CI environments where legacy command may not be available - Updates all subprocess.run calls to use ['docker', 'compose', ...] format
- Add docker_available() function to check if Docker is installed and working - Check for docker-compose.yml file existence - Skip all Docker integration tests when Docker is not available - Prevents test failures in CI environments without Docker
- Change docker-compose.yml to build image locally for tests - Add docker-compose.prod.yml for production use with Docker Hub image - Update README to show both options (pre-built vs build from source) - Update .dockerignore to exclude docker-compose files from build - This fixes CI failures due to non-existent Docker Hub image
- Exclude test_docker_integration.py from regular CI test runs - Add separate docker-test job that runs only on main or with 'docker' label - Remove CI-specific skips from Docker tests since they're excluded - This prevents port conflicts with CI's existing Meilisearch service
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.
Actionable comments posted: 1
🧹 Nitpick comments (5)
.github/workflows/test.yml (3)
55-56: Remove trailing spaces.
Lines 55–56 contain unnecessary whitespace at the end. Please trim trailing spaces to avoid YAMLlint errors.
61-61: Remove trailing spaces.
Line 61 has trailing whitespace. Please remove it.
78-78: Add newline at end of file.
EOF missing a trailing newline, which YAMLlint flags as an error.docker-compose.yml (1)
33-33: Add newline at end of file.
Please ensure the file ends with a newline to satisfy YAML linting rules.docker-compose.prod.yml (1)
31-31: Add newline at end of file.
A trailing newline is needed to comply with YAML standards.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.dockerignore(1 hunks).github/workflows/test.yml(1 hunks)README.md(1 hunks)docker-compose.prod.yml(1 hunks)docker-compose.yml(1 hunks)tests/test_docker_integration.py(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/test_docker_integration.py
🚧 Files skipped from review as they are similar to previous changes (2)
- README.md
- .dockerignore
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test.yml
63-63: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
66-66: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
.github/workflows/test.yml
[error] 56-56: trailing spaces
(trailing-spaces)
[error] 61-61: trailing spaces
(trailing-spaces)
[warning] 63-63: wrong indentation: expected 6 but found 4
(indentation)
[error] 64-64: trailing spaces
(trailing-spaces)
[error] 69-69: trailing spaces
(trailing-spaces)
[error] 75-75: trailing spaces
(trailing-spaces)
[error] 78-78: no new line character at the end of file
(new-line-at-end-of-file)
docker-compose.prod.yml
[error] 31-31: no new line character at the end of file
(new-line-at-end-of-file)
docker-compose.yml
[error] 33-33: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (3)
.github/workflows/test.yml (1)
63-66: Static analysis hint is a false positive.
Theactions/checkout@v3andactions/setup-python@v4references are current and valid; no update required.docker-compose.yml (1)
1-33: Docker Compose configuration looks good.
Services, volumes, and networks are well-defined and align with containerized deployment goals.docker-compose.prod.yml (1)
1-31: Production Compose setup is solid.
Themeilisearchandmeilisearch-mcpservices, along with the volume and network definitions, correctly mirror the development file for production usage.
- Remove docker-compose.yml and docker-compose.prod.yml files - Simplify Docker tests to only test image build and basic run - Update README to remove all docker-compose references - Remove docker-test job from CI workflow - Update .dockerignore to remove docker-compose references The repository now focuses solely on providing the Docker image. Users can run it directly with 'docker run' against their existing Meilisearch instances.
Summary
This PR adds Docker support to meilisearch-mcp, enabling users to run the MCP server in containerized environments like n8n workflows, Kubernetes, or any Docker-compatible platform.
Motivation
Fixes #47 - User requested Docker support for integration with n8n workflows.
Changes Made
🐳 Docker Configuration
📚 Documentation
🧪 Testing
test_docker_integration.pywith tests for:How to Test
Using Docker Compose (includes Meilisearch):
Standalone Docker:
docker build -t meilisearch-mcp . docker run -it \ -e MEILI_HTTP_ADDR=http://your-meilisearch:7700 \ -e MEILI_MASTER_KEY=your-key \ meilisearch-mcpRun integration tests:
n8n Integration
The Docker image can be easily integrated into n8n workflows as shown in the README example.
Notes
MEILI_HTTP_ADDRandMEILI_MASTER_KEYconfigure the connectionSummary by CodeRabbit
New Features
Documentation
Tests
Chores
.dockerignorefile to optimize Docker build context by excluding unnecessary and sensitive files.CI/CD