orchestrated-discussions/Dockerfile

117 lines
3.9 KiB
Docker

# Orchestrated Discussions - Multi-agent AI discussion orchestration
#
# Multi-stage build:
# Stage 1: Build SmartTools base
# Stage 2: Build Orchestrated Discussions with SmartTools
#
# 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: SmartTools Base
# ==============================================================================
FROM python:3.12-slim AS smarttools
WORKDIR /smarttools
# Clone SmartTools from Gitea (or provide build arg for local path)
ARG SMARTTOOLS_REPO=https://gitea.brrd.tech/rob/SmartTools.git
RUN apt-get update && apt-get install -y --no-install-recommends git && \
git clone ${SMARTTOOLS_REPO} . || \
echo "Clone failed - will need COPY in next stage"
# Install SmartTools
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 SmartTools from stage 1
COPY --from=smarttools /smarttools /smarttools
# Install SmartTools
RUN pip install --no-cache-dir -e /smarttools
# Copy Orchestrated Discussions files
COPY pyproject.toml README.md ./
COPY src/ ./src/
COPY smarttools/ ./smarttools/
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/.smarttools /root/.local/bin
# Install bundled discussion SmartTools
RUN for tool in smarttools/*/; do \
if [ -d "$tool" ]; then \
name=$(basename "$tool"); \
cp -r "$tool" /root/.smarttools/; \
printf '#!/bin/bash\nexec python3 -m smarttools.runner %s "$@"\n' "$name" > "/root/.local/bin/$name"; \
chmod +x "/root/.local/bin/$name"; \
fi; \
done
# Install SmartTools example tools and refresh wrappers
RUN python /smarttools/examples/install.py 2>/dev/null || true && \
smarttools 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 && \
smarttools 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