CascadingDev_simplified/docker-compose.yml

108 lines
3.2 KiB
YAML

# 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