docs(deploy): finalize multi-agent surface image handoff

This commit is contained in:
Mikhail Putilovskij 2026-04-28 20:11:27 +03:00
parent 51241d79e0
commit 5b537880ae
11 changed files with 361 additions and 27 deletions

View file

@ -1,4 +1,4 @@
FROM python:3.11-slim
FROM python:3.11-slim AS base
WORKDIR /app
@ -6,8 +6,11 @@ ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
ENV UV_PROJECT_ENVIRONMENT=/usr/local
# Install uv for dependency management inside the container.
RUN pip install --no-cache-dir uv
# Install uv and git for reproducible platform SDK installation.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir uv
# Copy dependency manifests first for layer caching.
COPY pyproject.toml uv.lock* ./
@ -15,15 +18,27 @@ COPY pyproject.toml uv.lock* ./
# Install project dependencies into the system environment.
RUN uv sync --no-dev --no-install-project --frozen
# Copy project source after dependency layers.
COPY . .
FROM base AS development
# Install the project itself.
# Local fullstack/dev builds can override the SDK with a checked-out agent_api
# build context, matching platform-agent's development Dockerfile pattern.
COPY --from=agent_api . /agent_api/
RUN python -m pip install --no-cache-dir --ignore-requires-python -e /agent_api/
COPY . .
RUN uv sync --no-dev --frozen
# Install lambda_agent_api from the vendored source tree.
# --ignore-requires-python: the package declares python<3.12 but works fine on 3.11;
# the guard exists for its own dev tooling, not the runtime API surface we use.
RUN pip install --no-cache-dir --ignore-requires-python /app/external/platform-agent_api
CMD ["python", "-m", "adapter.matrix.bot"]
FROM base AS production
# Production builds follow the platform-agent pattern: install the API SDK from
# the platform Git repository instead of relying on local external/ clones.
ARG LAMBDA_AGENT_API_REF=master
RUN python -m pip install --no-cache-dir --ignore-requires-python \
"git+https://git.lambda.coredump.ru/platform/agent_api.git@${LAMBDA_AGENT_API_REF}"
COPY . .
RUN uv sync --no-dev --frozen
CMD ["python", "-m", "adapter.matrix.bot"]