feat: import 6 MCP Dockerfile + base
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
FROM python:3.11-slim AS base
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN pip install --no-cache-dir "uv>=0.5,<0.7"
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml uv.lock ./
|
||||
COPY services/common ./services/common
|
||||
RUN uv sync --frozen --no-dev --package option-mcp-common
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
FROM base AS dev
|
||||
RUN uv sync --frozen --package option-mcp-common
|
||||
@@ -0,0 +1,24 @@
|
||||
ARG BASE_TAG=latest
|
||||
|
||||
FROM cerbero-base:${BASE_TAG} AS builder
|
||||
COPY services/mcp-alpaca ./services/mcp-alpaca
|
||||
RUN uv sync --frozen --no-dev --package mcp-alpaca
|
||||
|
||||
FROM python:3.11-slim AS runtime
|
||||
LABEL org.opencontainers.image.source="https://github.com/AdrianoDev/cerbero" \
|
||||
cerbero.service="mcp-alpaca"
|
||||
|
||||
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=9020
|
||||
EXPOSE 9020
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
||||
CMD python -c "import httpx, os; httpx.get(f'http://localhost:{os.environ.get(\"PORT\",\"9020\")}/health').raise_for_status()"
|
||||
|
||||
CMD ["mcp-alpaca"]
|
||||
@@ -0,0 +1,24 @@
|
||||
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 httpx, os; httpx.get(f'http://localhost:{os.environ.get(\"PORT\",\"9019\")}/health').raise_for_status()"
|
||||
|
||||
CMD ["mcp-bybit"]
|
||||
@@ -0,0 +1,26 @@
|
||||
# CER-P5-012 multi-stage slim: builder da cerbero-base (con uv + toolchain),
|
||||
# runtime da python:3.11-slim (solo venv + source).
|
||||
ARG BASE_TAG=latest
|
||||
|
||||
FROM cerbero-base:${BASE_TAG} AS builder
|
||||
COPY services/mcp-deribit ./services/mcp-deribit
|
||||
RUN uv sync --frozen --no-dev --package mcp-deribit
|
||||
|
||||
FROM python:3.11-slim AS runtime
|
||||
LABEL org.opencontainers.image.source="https://github.com/AdrianoDev/cerbero" \
|
||||
cerbero.service="mcp-deribit"
|
||||
|
||||
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=9011
|
||||
EXPOSE 9011
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
||||
CMD python -c "import httpx, os; httpx.get(f'http://localhost:{os.environ.get(\"PORT\",\"9011\")}/health').raise_for_status()"
|
||||
|
||||
CMD ["mcp-deribit"]
|
||||
@@ -0,0 +1,24 @@
|
||||
ARG BASE_TAG=latest
|
||||
|
||||
FROM cerbero-base:${BASE_TAG} AS builder
|
||||
COPY services/mcp-hyperliquid ./services/mcp-hyperliquid
|
||||
RUN uv sync --frozen --no-dev --package mcp-hyperliquid
|
||||
|
||||
FROM python:3.11-slim AS runtime
|
||||
LABEL org.opencontainers.image.source="https://github.com/AdrianoDev/cerbero" \
|
||||
cerbero.service="mcp-hyperliquid"
|
||||
|
||||
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=9012
|
||||
EXPOSE 9012
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
||||
CMD python -c "import httpx, os; httpx.get(f'http://localhost:{os.environ.get(\"PORT\",\"9012\")}/health').raise_for_status()"
|
||||
|
||||
CMD ["mcp-hyperliquid"]
|
||||
@@ -0,0 +1,24 @@
|
||||
ARG BASE_TAG=latest
|
||||
|
||||
FROM cerbero-base:${BASE_TAG} AS builder
|
||||
COPY services/mcp-macro ./services/mcp-macro
|
||||
RUN uv sync --frozen --no-dev --package mcp-macro
|
||||
|
||||
FROM python:3.11-slim AS runtime
|
||||
LABEL org.opencontainers.image.source="https://github.com/AdrianoDev/cerbero" \
|
||||
cerbero.service="mcp-macro"
|
||||
|
||||
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=9013
|
||||
EXPOSE 9013
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
||||
CMD python -c "import httpx, os; httpx.get(f'http://localhost:{os.environ.get(\"PORT\",\"9013\")}/health').raise_for_status()"
|
||||
|
||||
CMD ["mcp-macro"]
|
||||
@@ -0,0 +1,24 @@
|
||||
ARG BASE_TAG=latest
|
||||
|
||||
FROM cerbero-base:${BASE_TAG} AS builder
|
||||
COPY services/mcp-sentiment ./services/mcp-sentiment
|
||||
RUN uv sync --frozen --no-dev --package mcp-sentiment
|
||||
|
||||
FROM python:3.11-slim AS runtime
|
||||
LABEL org.opencontainers.image.source="https://github.com/AdrianoDev/cerbero" \
|
||||
cerbero.service="mcp-sentiment"
|
||||
|
||||
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=9014
|
||||
EXPOSE 9014
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
||||
CMD python -c "import httpx, os; httpx.get(f'http://localhost:{os.environ.get(\"PORT\",\"9014\")}/health').raise_for_status()"
|
||||
|
||||
CMD ["mcp-sentiment"]
|
||||
Reference in New Issue
Block a user