Skip to content

Commit 7f41370

Browse files
committed
Remove docker-compose entirely from the repository
- 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.
1 parent 52862fa commit 7f41370

File tree

6 files changed

+26
-202
lines changed

6 files changed

+26
-202
lines changed

.dockerignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,4 @@ logs/
6666

6767
# Test data
6868
tests/
69-
data.ms/
70-
71-
# Docker compose files
72-
docker-compose*.yml
69+
data.ms/

.github/workflows/test.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,4 @@ jobs:
5252
MEILI_HTTP_ADDR: http://localhost:7700
5353
MEILI_MASTER_KEY: test_master_key
5454
run: |
55-
pytest tests/ -v --ignore=tests/test_docker_integration.py
56-
57-
docker-test:
58-
runs-on: ubuntu-latest
59-
# Only run on main branch or when PR has 'docker' label
60-
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'docker')
61-
62-
steps:
63-
- uses: actions/checkout@v3
64-
65-
- name: Set up Python
66-
uses: actions/setup-python@v4
67-
with:
68-
python-version: '3.10'
69-
70-
- name: Install dependencies
71-
run: |
72-
python -m pip install --upgrade pip
73-
pip install -r requirements-dev.txt
74-
pip install -e .
75-
76-
- name: Run Docker integration tests
77-
run: |
78-
pytest tests/test_docker_integration.py -v
55+
pytest tests/ -v

README.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,6 @@ docker run -it \
157157
meilisearch/meilisearch-mcp:latest
158158
```
159159

160-
#### Using Docker Compose
161-
162-
```bash
163-
# Option 1: Use pre-built images (requires Docker Hub image to exist)
164-
curl -O https://raw.githubusercontent.com/meilisearch/meilisearch-mcp/main/docker-compose.prod.yml
165-
docker compose -f docker-compose.prod.yml up -d
166-
167-
# Option 2: Build from source
168-
git clone https://github.com/meilisearch/meilisearch-mcp.git
169-
cd meilisearch-mcp
170-
docker compose up -d
171-
```
172-
173160
#### Build from Source
174161

175162
```bash
@@ -181,11 +168,12 @@ docker run -it \
181168
meilisearch-mcp
182169
```
183170

184-
For n8n integration, use the Docker image in your workflow:
171+
#### Integration with n8n
172+
173+
For n8n workflows, you can use the Docker image directly in your setup:
185174
```yaml
186-
# Example n8n docker-compose service
187175
meilisearch-mcp:
188-
image: meilisearch-mcp:latest
176+
image: meilisearch/meilisearch-mcp:latest
189177
environment:
190178
- MEILI_HTTP_ADDR=http://meilisearch:7700
191179
- MEILI_MASTER_KEY=masterKey

docker-compose.prod.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

docker-compose.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/test_docker_integration.py

Lines changed: 20 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
"""
2-
Integration tests for Docker setup.
2+
Integration tests for Docker image build.
33
4-
These tests verify that the Docker container works correctly and can
5-
communicate with Meilisearch.
4+
These tests verify that the Docker image can be built successfully.
65
"""
7-
import os
86
import subprocess
9-
import time
107
import pytest
11-
import requests
128
import shutil
139

1410

@@ -17,9 +13,6 @@ def docker_available():
1713
"""Check if Docker is available on the system."""
1814
if not shutil.which("docker"):
1915
return False
20-
# Also check if docker-compose.yml exists
21-
if not os.path.exists("docker-compose.yml"):
22-
return False
2316
# Try to run docker version to ensure it's working
2417
try:
2518
result = subprocess.run(
@@ -36,41 +29,10 @@ def docker_available():
3629
# Skip all tests in this module if Docker is not available
3730
pytestmark = pytest.mark.skipif(
3831
not docker_available(),
39-
reason="Docker not available on this system or docker-compose.yml not found"
32+
reason="Docker not available on this system"
4033
)
4134

4235

43-
def wait_for_service(url, timeout=30):
44-
"""Wait for a service to become available."""
45-
start_time = time.time()
46-
while time.time() - start_time < timeout:
47-
try:
48-
response = requests.get(f"{url}/health")
49-
if response.status_code == 200:
50-
return True
51-
except requests.exceptions.ConnectionError:
52-
pass
53-
time.sleep(1)
54-
return False
55-
56-
57-
@pytest.fixture(scope="module")
58-
def docker_services():
59-
"""Start Docker services for testing."""
60-
# Start services
61-
subprocess.run(["docker", "compose", "up", "-d"], check=True)
62-
63-
# Wait for Meilisearch to be ready
64-
if not wait_for_service("http://localhost:7700"):
65-
subprocess.run(["docker", "compose", "down"], check=True)
66-
pytest.fail("Meilisearch failed to start")
67-
68-
yield
69-
70-
# Cleanup
71-
subprocess.run(["docker", "compose", "down", "-v"], check=True)
72-
73-
7436
def test_docker_build():
7537
"""Test that the Docker image can be built successfully."""
7638
result = subprocess.run(
@@ -81,69 +43,33 @@ def test_docker_build():
8143
assert result.returncode == 0, f"Docker build failed: {result.stderr}"
8244

8345

84-
def test_meilisearch_connectivity(docker_services):
85-
"""Test that the MCP container can connect to Meilisearch."""
86-
# Run a simple connectivity test in the container
87-
result = subprocess.run(
88-
[
89-
"docker", "compose", "run", "--rm", "meilisearch-mcp",
90-
"python", "-c",
91-
"""
92-
import os
93-
from meilisearch import Client
94-
client = Client(os.getenv('MEILI_HTTP_ADDR'), os.getenv('MEILI_MASTER_KEY'))
95-
health = client.health()
96-
assert health['status'] == 'available'
97-
print('SUCCESS: Connected to Meilisearch')
98-
"""
99-
],
100-
capture_output=True,
101-
text=True
102-
)
103-
104-
assert result.returncode == 0, f"Connectivity test failed: {result.stderr}"
105-
assert "SUCCESS: Connected to Meilisearch" in result.stdout
106-
107-
108-
def test_mcp_server_import(docker_services):
109-
"""Test that the MCP server module can be imported in the container."""
110-
result = subprocess.run(
111-
[
112-
"docker", "compose", "run", "--rm", "meilisearch-mcp",
113-
"python", "-c",
114-
"""
115-
import src.meilisearch_mcp
116-
from src.meilisearch_mcp.server import MeilisearchMCPServer
117-
print('SUCCESS: MCP server imported')
118-
"""
119-
],
46+
def test_docker_image_runs():
47+
"""Test that the Docker image can run and show help."""
48+
# First build the image
49+
build_result = subprocess.run(
50+
["docker", "build", "-t", "meilisearch-mcp-test", "."],
12051
capture_output=True,
12152
text=True
12253
)
54+
if build_result.returncode != 0:
55+
pytest.skip(f"Docker build failed: {build_result.stderr}")
12356

124-
assert result.returncode == 0, f"Import test failed: {result.stderr}"
125-
assert "SUCCESS: MCP server imported" in result.stdout
126-
127-
128-
def test_environment_variables(docker_services):
129-
"""Test that environment variables are correctly set in the container."""
57+
# Try to run the container and check it starts
13058
result = subprocess.run(
13159
[
132-
"docker", "compose", "run", "--rm", "meilisearch-mcp",
133-
"python", "-c",
134-
"""
135-
import os
136-
assert os.getenv('MEILI_HTTP_ADDR') == 'http://meilisearch:7700'
137-
assert os.getenv('MEILI_MASTER_KEY') == 'masterKey'
138-
print('SUCCESS: Environment variables are correct')
139-
"""
60+
"docker", "run", "--rm",
61+
"-e", "MEILI_HTTP_ADDR=http://localhost:7700",
62+
"-e", "MEILI_MASTER_KEY=test",
63+
"meilisearch-mcp-test",
64+
"python", "-c", "import src.meilisearch_mcp; print('MCP module loaded successfully')"
14065
],
14166
capture_output=True,
142-
text=True
67+
text=True,
68+
timeout=30
14369
)
14470

145-
assert result.returncode == 0, f"Environment test failed: {result.stderr}"
146-
assert "SUCCESS: Environment variables are correct" in result.stdout
71+
assert result.returncode == 0, f"Docker run failed: {result.stderr}"
72+
assert "MCP module loaded successfully" in result.stdout
14773

14874

14975
if __name__ == "__main__":

0 commit comments

Comments
 (0)