6b7b3f7658
- mcp_common/http.py: nuovo helper async_client() con AsyncHTTPTransport(retries=3) per gestire connection error transient + call_with_retry() generic async retry decorator. Sostituite 25 occorrenze httpx.AsyncClient(...) in deribit/hyperliquid/sentiment/ macro client. 5 nuovi test. - Dockerfile healthcheck: passato da python+httpx subprocess a stdlib urllib.request.urlopen() su tutti i 6 servizi MCP. Zero dipendenze esterne nel runtime check, timeout esplicito 3s, image leggermente più snella. - pyproject.toml: aggiunto [tool.mypy] python_version=3.13 con mypy_path multi-package + override ignore_missing_imports per i vendor SDK (pybit, alpaca, hyperliquid, pythonjsonlogger). mypy 1.20 in dev deps; ruff pinned 0.5.x. mcp_common passa mypy clean; 44 errori tipo pre-esistenti nei servizi affiorati ma non bloccanti — fix da pianificare separatamente. - 455 test verdi. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
25 lines
704 B
Docker
25 lines
704 B
Docker
ARG BASE_TAG=latest
|
|
|
|
FROM cerbero-base:${BASE_TAG} AS builder
|
|
COPY services/mcp-bybit ./services/mcp-bybit
|
|
RUN uv sync --frozen --no-dev --package mcp-bybit
|
|
|
|
FROM python:3.11-slim AS runtime
|
|
LABEL org.opencontainers.image.source="https://github.com/AdrianoDev/cerbero" \
|
|
cerbero.service="mcp-bybit"
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /app /app
|
|
ENV PATH="/app/.venv/bin:$PATH"
|
|
|
|
RUN useradd -m -u 1000 app
|
|
USER app
|
|
|
|
ENV HOST=0.0.0.0 PORT=9019
|
|
EXPOSE 9019
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
|
CMD python -c "import os, urllib.request; urllib.request.urlopen(f'http://localhost:{os.environ.get(\"PORT\",\"9019\")}/health', timeout=3).close()"
|
|
|
|
CMD ["mcp-bybit"]
|