Skip to content

Commit 6c824e1

Browse files
feat: add b00t-enhanced container with MCP server integration
Implement multi-service container combining PlantUML Server (Java) and MCP server (Node.js) for b00t TOGAF diagram generation workflows. Components added: - Dockerfile.b00t: Multi-stage build (Java + Node.js + supervisord) - supervisord.conf: Process manager for concurrent services - .github/workflows/build-b00t-container.yml: CI/CD automation Architecture: eclipse-temurin:17 + Node.js 18 + supervisord Container: ghcr.io/promptexecution/plantuml-server--b00t--togaf--mcp Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4df3539 commit 6c824e1

File tree

3 files changed

+235
-0
lines changed

3 files changed

+235
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Build b00t PlantUML Container
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
tags:
9+
- 'v*'
10+
paths:
11+
- 'Dockerfile.b00t'
12+
- 'supervisord.conf'
13+
- '.github/workflows/build-b00t-container.yml'
14+
pull_request:
15+
branches:
16+
- main
17+
paths:
18+
- 'Dockerfile.b00t'
19+
- 'supervisord.conf'
20+
workflow_dispatch:
21+
inputs:
22+
plantuml_version:
23+
description: 'PlantUML version to build'
24+
required: false
25+
default: '1.2024.3'
26+
mcp_server_version:
27+
description: 'MCP server version'
28+
required: false
29+
default: '0.1.11'
30+
31+
env:
32+
REGISTRY: ghcr.io
33+
IMAGE_NAME: ${{ github.repository }}
34+
35+
jobs:
36+
build-and-push:
37+
runs-on: ubuntu-latest
38+
permissions:
39+
contents: read
40+
packages: write
41+
id-token: write
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
46+
47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@v3
49+
with:
50+
platforms: linux/amd64,linux/arm64
51+
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Log in to GitHub Container Registry
56+
uses: docker/login-action@v3
57+
with:
58+
registry: ${{ env.REGISTRY }}
59+
username: ${{ github.actor }}
60+
password: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Extract metadata (tags, labels)
63+
id: meta
64+
uses: docker/metadata-action@v5
65+
with:
66+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67+
tags: |
68+
type=ref,event=branch
69+
type=ref,event=pr
70+
type=semver,pattern={{version}}
71+
type=semver,pattern={{major}}.{{minor}}
72+
type=sha,prefix={{branch}}-
73+
type=raw,value=latest,enable={{is_default_branch}}
74+
type=raw,value=b00t-latest,enable={{is_default_branch}}
75+
76+
- name: Build and push Docker image
77+
id: build-and-push
78+
uses: docker/build-push-action@v5
79+
with:
80+
context: .
81+
file: ./Dockerfile.b00t
82+
platforms: linux/amd64,linux/arm64
83+
push: ${{ github.event_name != 'pull_request' }}
84+
tags: ${{ steps.meta.outputs.tags }}
85+
labels: ${{ steps.meta.outputs.labels }}
86+
build-args: |
87+
PLANTUML_VERSION=${{ github.event.inputs.plantuml_version || '1.2024.3' }}
88+
MCP_SERVER_VERSION=${{ github.event.inputs.mcp_server_version || '0.1.11' }}
89+
NODE_VERSION=18-alpine
90+
cache-from: type=gha
91+
cache-to: type=gha,mode=max
92+
93+
- name: Generate SBOM
94+
if: github.event_name != 'pull_request'
95+
uses: anchore/sbom-action@v0
96+
with:
97+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
98+
format: spdx-json
99+
output-file: sbom.spdx.json
100+
101+
- name: Upload SBOM artifact
102+
if: github.event_name != 'pull_request'
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: sbom-plantuml-b00t
106+
path: sbom.spdx.json
107+
retention-days: 30
108+
109+
- name: Image digest
110+
if: github.event_name != 'pull_request'
111+
run: echo ${{ steps.build-and-push.outputs.digest }}

Dockerfile.b00t

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Dockerfile.b00t - b00t-enhanced PlantUML Server with MCP Integration
2+
# Multi-stage build combining PlantUML Server (Java) + MCP Server (Node.js)
3+
# Managed by supervisord for concurrent service execution
4+
5+
ARG PLANTUML_VERSION=1.2024.3
6+
ARG NODE_VERSION=18-alpine
7+
ARG MCP_SERVER_VERSION=0.1.11
8+
9+
# ============================================================================
10+
# Stage 1: Build PlantUML Server (Java)
11+
# ============================================================================
12+
FROM eclipse-temurin:17-jre-alpine AS plantuml-builder
13+
14+
ARG PLANTUML_VERSION
15+
WORKDIR /app
16+
17+
# Download specific PlantUML version
18+
RUN wget -O plantuml.jar \
19+
"https://github.com/plantuml/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-${PLANTUML_VERSION}.jar" \
20+
&& chmod 644 plantuml.jar
21+
22+
# ============================================================================
23+
# Stage 2: Prepare MCP Server (Node.js)
24+
# ============================================================================
25+
FROM node:${NODE_VERSION} AS mcp-builder
26+
27+
ARG MCP_SERVER_VERSION
28+
WORKDIR /mcp
29+
30+
# Install plantuml-mcp-server globally
31+
RUN npm install -g plantuml-mcp-server@${MCP_SERVER_VERSION} && \
32+
npm cache clean --force
33+
34+
# ============================================================================
35+
# Stage 3: Runtime Image (Java + Node.js + Supervisord)
36+
# ============================================================================
37+
FROM eclipse-temurin:17-jre-alpine
38+
39+
# Install Node.js runtime and supervisor for process management
40+
RUN apk add --no-cache \
41+
nodejs \
42+
npm \
43+
supervisor \
44+
wget \
45+
curl \
46+
&& rm -rf /var/cache/apk/*
47+
48+
# Create application directories
49+
RUN mkdir -p /opt/plantuml /opt/mcp /var/log/supervisor /diagrams
50+
51+
# Copy PlantUML JAR from builder stage
52+
COPY --from=plantuml-builder /app/plantuml.jar /opt/plantuml/plantuml.jar
53+
54+
# Copy MCP server from builder stage
55+
COPY --from=mcp-builder /usr/local/lib/node_modules/plantuml-mcp-server \
56+
/usr/local/lib/node_modules/plantuml-mcp-server
57+
58+
# Create symlink for MCP server binary
59+
RUN ln -s /usr/local/lib/node_modules/plantuml-mcp-server/bin/plantuml-mcp-server \
60+
/usr/local/bin/plantuml-mcp-server
61+
62+
# Copy supervisord configuration
63+
COPY supervisord.conf /etc/supervisord.conf
64+
65+
# Environment configuration
66+
ENV PLANTUML_SERVER_URL=http://localhost:8080/plantuml \
67+
PLANTUML_LIMIT_SIZE=16384 \
68+
PLANTUML_SECURITY_PROFILE=INTERNET \
69+
MCP_SERVER_PORT=3000 \
70+
JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Xmx512m"
71+
72+
# Expose ports
73+
# 8080: PlantUML HTTP server
74+
# 3000: MCP server (if using HTTP transport)
75+
EXPOSE 8080 3000
76+
77+
# Health check for PlantUML server availability
78+
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
79+
CMD wget -q --spider http://localhost:8080/plantuml || exit 1
80+
81+
# Volume for optional diagram persistence
82+
VOLUME ["/diagrams"]
83+
84+
# Labels for container metadata
85+
LABEL org.opencontainers.image.title="PlantUML Server b00t" \
86+
org.opencontainers.image.description="PlantUML Server with integrated MCP server for b00t TOGAF workflows" \
87+
org.opencontainers.image.vendor="PromptExecution" \
88+
org.opencontainers.image.source="https://github.com/PromptExecution/plantuml-server--b00t--togaf--mcp" \
89+
org.opencontainers.image.licenses="GPL-3.0"
90+
91+
# Start supervisord to manage both PlantUML and MCP servers
92+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf", "-n"]

supervisord.conf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[supervisord]
2+
nodaemon=true
3+
user=root
4+
logfile=/var/log/supervisor/supervisord.log
5+
pidfile=/var/run/supervisord.pid
6+
childlogdir=/var/log/supervisor
7+
8+
[program:plantuml-server]
9+
command=java %(ENV_JAVA_OPTS)s -jar /opt/plantuml/plantuml.jar -Djava.net.preferIPv4Stack=true -Djetty.http.port=8080
10+
directory=/opt/plantuml
11+
autostart=true
12+
autorestart=true
13+
startretries=3
14+
stdout_logfile=/dev/stdout
15+
stdout_logfile_maxbytes=0
16+
stderr_logfile=/dev/stderr
17+
stderr_logfile_maxbytes=0
18+
priority=100
19+
20+
[program:mcp-server]
21+
command=plantuml-mcp-server
22+
directory=/opt/mcp
23+
autostart=true
24+
autorestart=true
25+
startretries=3
26+
environment=PLANTUML_SERVER_URL="%(ENV_PLANTUML_SERVER_URL)s",NODE_ENV="production"
27+
stdout_logfile=/dev/stdout
28+
stdout_logfile_maxbytes=0
29+
stderr_logfile=/dev/stderr
30+
stderr_logfile_maxbytes=0
31+
priority=200
32+
# MCP server starts after PlantUML server (higher priority number = later start)

0 commit comments

Comments
 (0)