Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Maestro MCP Docker Guide

This guide explains how to build and run Maestro MCP using Docker.

## Prerequisites

- Docker installed on your system
- Git repository cloned locally

## Quick Start

The easiest way to build and run Maestro MCP in Docker is to use the provided script:

```bash
./docker-build-run.sh
```

This script will:
1. Build the Docker image
2. Stop and remove any existing Maestro MCP container
3. Start a new container with the appropriate settings
4. Mount your local `config.yaml` into the container

Once running, you can access Maestro MCP at: http://localhost:8030

## Manual Docker Commands

If you prefer to run the Docker commands manually:

### Build the Docker image

```bash
docker build -t maestro-mcp:latest .
```

### Run the Docker container

```bash
docker run -d \
--name maestro-mcp \
-p 8030:8030 \
-v "$(pwd)/config.yaml:/app/config.yaml" \
maestro-mcp:latest
```

### Stop the container

```bash
docker stop maestro-mcp
```

### View container logs

```bash
docker logs maestro-mcp
```

## Configuration

The Docker container uses the `config.yaml` file for configuration. By default, it mounts your local `config.yaml` file into the container.

You can also override configuration settings using environment variables. For example:

```bash
docker run -d \
--name maestro-mcp \
-p 8030:8030 \
-e MAESTRO_MCP_SERVER_PORT=8030 \
-e MAESTRO_MCP_LOGGING_LEVEL=debug \
-v "$(pwd)/config.yaml:/app/config.yaml" \
maestro-mcp:latest
```

See the `.env.example` file for all available environment variables.

## Customizing the Docker Image

If you need to customize the Docker image, you can modify the `Dockerfile` and rebuild:

1. Edit the `Dockerfile`
2. Rebuild the image: `docker build -t maestro-mcp:custom .`
3. Run with your custom image: `docker run -d --name maestro-mcp -p 8030:8030 maestro-mcp:custom`

## Troubleshooting

### Container fails to start

Check the logs for errors:

```bash
docker logs maestro-mcp
```

### Port conflicts

If port 8030 is already in use, you can map to a different port:

```bash
docker run -d --name maestro-mcp -p 8031:8030 maestro-mcp:latest
```

Then access Maestro MCP at http://localhost:8031
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Build stage
FROM golang:1.24 AS builder

# Set working directory
WORKDIR /app

# Copy go.mod and go.sum files
COPY go.mod go.sum ./

# Download dependencies
RUN go mod download

# Copy the source code
COPY . .

# Build the application
RUN ./build.sh

# Final stage
FROM debian:bookworm-slim

# Set working directory
WORKDIR /app

# Install necessary runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Copy the binary from the builder stage
COPY --from=builder /app/bin/maestro-mcp /app/maestro-mcp

# Copy configuration files
COPY --from=builder /app/config.yaml /app/config.yaml

# Create directory for database files if needed
RUN mkdir -p /app/data

# Set environment variables
ENV MAESTRO_MCP_SERVER_HOST=0.0.0.0
ENV MAESTRO_MCP_SERVER_PORT=8030

# Expose the port
EXPOSE 8030

# Set the entry point
ENTRYPOINT ["/app/maestro-mcp"]
86 changes: 86 additions & 0 deletions docker-build-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env bash

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

print_status() {
echo -e "${GREEN}[INFO]${NC} $1"
}

print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}

print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}

print_header() {
echo -e "${BLUE}[DOCKER]${NC} $1"
}

# Build the Docker image
build_image() {
print_header "Building Maestro MCP Docker image..."
if docker build -t maestro-mcp:latest .; then
print_status "Docker image built successfully!"
else
print_error "Failed to build Docker image"
exit 1
fi
}

# Run the Docker container
run_container() {
print_header "Running Maestro MCP Docker container..."

# Check if container is already running
if docker ps | grep -q maestro-mcp; then
print_warning "Maestro MCP container is already running"
print_status "Stopping existing container..."
docker stop maestro-mcp
fi

# Remove existing container if it exists
if docker ps -a | grep -q maestro-mcp; then
print_status "Removing existing container..."
docker rm maestro-mcp
fi

# Run the container
print_status "Starting new container..."
if docker run -d \
--name maestro-mcp \
-p 8030:8030 \
-v "$(pwd)/config.yaml:/app/config.yaml" \
maestro-mcp:latest; then
print_status "Container started successfully!"
print_status "Maestro MCP is running at http://localhost:8030"
else
print_error "Failed to start container"
exit 1
fi
}

# Main execution
print_header "Maestro MCP Docker Build & Run"
echo "====================================="

# Build the image
build_image

# Run the container
run_container

print_header "Done! 🎉"
echo "====================================="
print_status "Maestro MCP is now running in Docker"
print_status "Access the server at: http://localhost:8030"
print_status "To stop the container: docker stop maestro-mcp"
print_status "To view logs: docker logs maestro-mcp"

# Made with Bob
86 changes: 76 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,100 @@ go 1.24.4
toolchain go1.24.7

require (
github.com/gin-contrib/cors v1.7.6
github.com/gin-gonic/gin v1.11.0
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
go.uber.org/zap v1.27.0
k8s.io/api v0.34.1
k8s.io/apimachinery v0.34.1
k8s.io/client-go v0.34.1
)

require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/bytedance/sonic v1.14.0 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
github.com/gin-contrib/sse v1.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.27.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/goccy/go-yaml v1.18.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.54.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.3.0 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
go.uber.org/mock v0.5.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.20.0 // indirect
golang.org/x/crypto v0.40.0 // indirect
golang.org/x/mod v0.25.0 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/term v0.33.0 // indirect
golang.org/x/time v0.9.0 // indirect
golang.org/x/tools v0.34.0 // indirect
google.golang.org/protobuf v1.36.9 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/frankban/quicktest v1.14.5 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/mark3labs/mcp-go v0.41.1
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.27.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1
)
Loading
Loading