Add Docker support

- Dockerfile with Python 3.12, git, and optional Qt6 for GUI
- docker-compose.yml with services: cli, build, test-install, gui, shell

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rob 2025-12-28 14:46:06 -04:00
parent e37b1a9722
commit 7ae2024c83
2 changed files with 174 additions and 0 deletions

67
Dockerfile Normal file
View File

@ -0,0 +1,67 @@
# CascadingDev Simplified - Git-native AI collaboration framework
#
# Build: docker build -t cascadingdev .
# Test: docker run -it --rm cascadingdev cdev --help
FROM python:3.12-slim
LABEL maintainer="rob"
LABEL description="CascadingDev - Git hooks and cascading rules framework"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
# Qt6 dependencies for Ramble GUI (optional)
libgl1-mesa-glx \
libegl1-mesa \
libxkbcommon0 \
libdbus-1-3 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-keysyms1 \
libxcb-shape0 \
libxcb-xinerama0 \
libxcb-randr0 \
libxcb-render-util0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy project files
COPY pyproject.toml VERSION README.md ./
COPY src/ ./src/
COPY assets/ ./assets/
COPY tools/ ./tools/
COPY docs/ ./docs/
# Install CascadingDev
RUN pip install --no-cache-dir -e .
# Install PySide6 for Ramble GUI (optional, makes image larger)
RUN pip install --no-cache-dir PySide6 || true
# Verify installation
RUN cdev --help
# Default: show help
CMD ["cdev", "--help"]
# ==============================================================================
# Usage Examples
# ==============================================================================
# Build:
# docker build -t cascadingdev .
#
# Show help:
# docker run -it --rm cascadingdev
#
# Build installer bundle:
# docker run -it --rm -v $(pwd)/output:/output cascadingdev \
# bash -c "cdev build && cp -r install/* /output/"
#
# Install into a new project (headless):
# docker run -it --rm -v /path/to/project:/project cascadingdev \
# python install/cascadingdev-*/setup_cascadingdev.py --target /project --no-ramble
#
# Interactive shell:
# docker run -it --rm cascadingdev bash

107
docker-compose.yml Normal file
View File

@ -0,0 +1,107 @@
# CascadingDev Simplified - Docker Compose
#
# Quick Start:
# docker-compose build # Build the image
# docker-compose run --rm cli # Show help
# docker-compose run --rm build # Build installer bundle
# docker-compose run --rm shell # Interactive shell
version: '3.8'
services:
# ============================================================================
# CLI (show help)
# ============================================================================
cli:
build:
context: .
dockerfile: Dockerfile
image: cascadingdev:latest
command: ["cdev", "--help"]
# ============================================================================
# Build installer bundle
# ============================================================================
build:
build:
context: .
dockerfile: Dockerfile
image: cascadingdev:latest
volumes:
- ./output:/output
command: ["bash", "-c", "cdev build && cp -r install/* /output/ && echo 'Installer bundle copied to ./output/'"]
# ============================================================================
# Test installation (creates project in /tmp)
# ============================================================================
test-install:
build:
context: .
dockerfile: Dockerfile
image: cascadingdev:latest
command: >
bash -c "
cdev build &&
python install/cascadingdev-*/setup_cascadingdev.py --target /tmp/test-project --no-ramble &&
echo '=== Installation successful ===' &&
ls -la /tmp/test-project/ &&
echo '=== Pre-commit hook ===' &&
cat /tmp/test-project/.git/hooks/pre-commit | head -30
"
# ============================================================================
# GUI (requires X11 forwarding)
# ============================================================================
gui:
build:
context: .
dockerfile: Dockerfile
image: cascadingdev:latest
environment:
- DISPLAY=${DISPLAY:-:0}
- QT_QPA_PLATFORM=xcb
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:ro
- ./output:/output
command: >
bash -c "
cdev build &&
python install/cascadingdev-*/setup_cascadingdev.py --target /output/test-project
"
network_mode: host
# ============================================================================
# Interactive Shell
# ============================================================================
shell:
build:
context: .
dockerfile: Dockerfile
image: cascadingdev:latest
volumes:
- ./output:/output
command: ["/bin/bash"]
stdin_open: true
tty: true
# ==============================================================================
# Usage Examples
# ==============================================================================
#
# Build image:
# docker-compose build
#
# Show CLI help:
# docker-compose run --rm cli
#
# Build installer bundle (outputs to ./output/):
# docker-compose run --rm build
#
# Test installation in container:
# docker-compose run --rm test-install
#
# Interactive shell:
# docker-compose run --rm shell
#
# GUI with Ramble (requires: xhost +local:docker):
# docker-compose run --rm gui