orchestrated-discussions/Dockerfile

117 lines
3.8 KiB
Docker

# Orchestrated Discussions - Multi-agent AI discussion orchestration
#
# Multi-stage build:
# Stage 1: Build CmdForge base
# Stage 2: Build Orchestrated Discussions with CmdForge
#
# Build: docker build -t orchestrated-discussions .
# Run: docker run -it --rm orchestrated-discussions discussions --help
# Test: docker run -it --rm orchestrated-discussions pytest -v
# ==============================================================================
# Stage 1: CmdForge Base
# ==============================================================================
FROM python:3.12-slim AS cmdforge
WORKDIR /cmdforge
# Clone CmdForge from Gitea (or provide build arg for local path)
ARG CMDFORGE_REPO=https://gitea.brrd.tech/rob/CmdForge.git
RUN apt-get update && apt-get install -y --no-install-recommends git && \
git clone ${CMDFORGE_REPO} . || \
echo "Clone failed - will need COPY in next stage"
# Install CmdForge
RUN pip install --no-cache-dir -e . || true
# ==============================================================================
# Stage 2: Orchestrated Discussions
# ==============================================================================
FROM python:3.12-slim
LABEL maintainer="rob"
LABEL description="Orchestrated Discussions - Multi-agent AI discussion framework"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
plantuml \
jq \
nano \
# GUI dependencies for dearpygui
libgl1 \
libegl1 \
libxkbcommon0 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-keysyms1 \
libxcb-shape0 \
libxcb-xinerama0 \
libxcb-randr0 \
libxcb-render-util0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy CmdForge from stage 1
COPY --from=cmdforge /cmdforge /cmdforge
# Install CmdForge
RUN pip install --no-cache-dir -e /cmdforge
# Copy Orchestrated Discussions files
COPY pyproject.toml README.md ./
COPY src/ ./src/
COPY cmdforge/ ./cmdforge/
COPY templates/ ./templates/
COPY examples/ ./examples/
COPY tests/ ./tests/
# Install Orchestrated Discussions
RUN pip install --no-cache-dir -e ".[dev]"
# Install dearpygui for GUI (optional, may fail on some systems)
RUN pip install --no-cache-dir dearpygui || echo "dearpygui install failed, GUI will use TUI fallback"
# Create directories
RUN mkdir -p /root/.cmdforge /root/.local/bin
# Install bundled discussion CmdForge tools
RUN for tool in cmdforge/*/; do \
if [ -d "$tool" ]; then \
name=$(basename "$tool"); \
cp -r "$tool" /root/.cmdforge/; \
printf '#!/bin/bash\nexec python3 -m cmdforge.runner %s "$@"\n' "$name" > "/root/.local/bin/$name"; \
chmod +x "/root/.local/bin/$name"; \
fi; \
done
# Install CmdForge example tools and refresh wrappers
RUN python /cmdforge/examples/install.py 2>/dev/null || true && \
cmdforge refresh 2>/dev/null || true
# Add local bin to PATH
ENV PATH="/root/.local/bin:${PATH}"
# Healthcheck - verify key commands work
RUN discussions --help && \
discussion-parser --help && \
cmdforge list | head -5
# Default: run tests
CMD ["pytest", "-v", "tests/"]
# ==============================================================================
# Usage Examples:
# ==============================================================================
# docker build -t orchestrated-discussions .
# docker run -it --rm orchestrated-discussions # Run tests
# docker run -it --rm orchestrated-discussions discussions --help # CLI help
# docker run -it --rm orchestrated-discussions discussions participants # List participants
# docker run -it --rm orchestrated-discussions bash # Interactive shell
#
# With mounted examples:
# docker run -it --rm -v $(pwd)/examples:/app/examples orchestrated-discussions \
# discussions status /app/examples/feature_discussion.discussion.md