Skip to content

Commit a2c9982

Browse files
HanSur94claude
andcommitted
fix(ci): simplify Docker healthcheck to TCP socket probe
HTTP-level healthcheck against /mcp has framing issues. A TCP socket connection to port 8765 is sufficient to confirm Uvicorn is accepting connections. The client script handles MCP-level retries itself. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5e48a6f commit a2c9982

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

docker-compose.test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ services:
1818
networks:
1919
- mcp-test-net
2020
healthcheck:
21-
test: ["CMD", "python", "-c", "import urllib.request,json,sys; r=urllib.request.urlopen(urllib.request.Request('http://localhost:8765/mcp',data=json.dumps({'jsonrpc':'2.0','method':'initialize','id':0,'params':{'protocolVersion':'2024-11-05','capabilities':{},'clientInfo':{'name':'hc','version':'0.1'}}}).encode(),headers={'Content-Type':'application/json','Authorization':'Bearer test-token-for-ci'}),timeout=3); sys.exit(0 if r.status<500 else 1)"]
22-
interval: 3s
23-
timeout: 5s
24-
retries: 15
25-
start_period: 10s
21+
test: ["CMD", "python", "-c", "import socket; s=socket.create_connection(('localhost',8765),timeout=2); s.close()"]
22+
interval: 2s
23+
timeout: 3s
24+
retries: 20
25+
start_period: 5s
2626

2727
client:
2828
build: .

0 commit comments

Comments
 (0)