portainer-mcp/build-docker.sh
Adolfo Delorenzo 2098453ff1 feat: add Docker support for all MCP servers
- Create individual Dockerfiles for each of the 7 MCP servers
- Add docker-compose.yml for orchestrating all services
- Create build-docker.sh script for easy container building
- Add comprehensive Docker deployment documentation (DOCKER.md)
- Update main README with Docker installation instructions
- Add .env.example template for environment configuration
- Configure each server with dedicated ports (3000-3006)
- Implement security best practices (non-root user, minimal base image)
- Add production deployment considerations and troubleshooting guide

Each server can now be run individually or all together using Docker Compose,
making deployment and scaling much easier for production environments.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 00:12:39 -03:00

57 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Build script for Portainer MCP Docker containers
set -e
echo "Building Portainer MCP Docker containers..."
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Check if .env file exists
if [ ! -f .env ]; then
echo "Creating .env file from template..."
cat > .env << EOF
# Required
PORTAINER_URL=https://your-portainer-instance.com
PORTAINER_API_KEY=your-api-key-here
# Optional
PORTAINER_INSECURE=false
HTTP_TIMEOUT=30
MAX_RETRIES=3
EOF
echo -e "${BLUE}Please edit .env file with your Portainer credentials${NC}"
exit 1
fi
# Build individual containers
build_container() {
local name=$1
echo -e "${BLUE}Building portainer-${name}...${NC}"
docker build -f docker/Dockerfile.${name} -t portainer-mcp-${name}:latest .
echo -e "${GREEN}✓ portainer-${name} built successfully${NC}"
}
# Build all containers
if [ "$1" == "all" ] || [ -z "$1" ]; then
for server in core environments docker kubernetes stacks edge gitops; do
build_container $server
done
else
# Build specific container
build_container $1
fi
echo -e "${GREEN}Build complete!${NC}"
echo ""
echo "To run all containers:"
echo " docker-compose up -d"
echo ""
echo "To run a specific container:"
echo " docker-compose up -d portainer-<service>"
echo ""
echo "Available services: core, environments, docker, kubernetes, stacks, edge, gitops"