Skip to content

feat: complete Docker containerization with Compose and automation

Add comprehensive Docker and Docker Compose setup for containerized deployment:

  • Dockerfile: Multi-stage build (golang:1.25.1-alpine → alpine:latest)

    • Static binary compilation with CGO_ENABLED=0
    • Non-root user (mcp:1000) for security
    • Health check endpoint support
    • ca-certificates for HTTPS
  • docker-compose.yml: Orchestration configuration

    • MCP Server service (port 8080) with health checks
    • Ollama service (port 11434) with persistent models volume
    • Custom bridge network for service communication
    • Environment variable configuration from .env file
    • Logging configuration for all services
  • docker-compose.override.yml: Development template

    • Volume mounts for live code reload
    • Debug logging configuration
    • Optional GPU and debugger setup commented out
  • .dockerignore: Minimal image footprint

    • Excludes environment, documentation, and build artifacts
  • scripts/ollama-init.sh: Model initialization automation

    • Health checks with retry logic (30 attempts)
    • Automatic model listing and pulling
    • Comprehensive error handling and colored output
  • Makefile: 40+ targets for development and operations

    • Local development: build, run, test, fmt, lint, vet
    • Docker operations: docker-up/down, docker-logs, docker-test
    • Ollama management: docker-init-ollama, docker-pull-model
    • CI/CD targets: ci-test, ci-build, ci-docker
  • docs/DOCKER.md: Comprehensive Docker setup guide

    • Quick start instructions
    • Architecture overview with diagram
    • Configuration and environment variables
    • Common commands and troubleshooting
    • Advanced configuration (GPU, debugging, resource limits)
    • Ollama model management guide
  • Updated CLAUDE.md with Docker deployment section

    • Quick start with Docker Compose
    • Key files and common commands
    • Links to comprehensive documentation
  • Updated .env.example with Docker-specific configuration

    • Docker-specific variable notes
    • Internal service DNS documentation
    • OLLAMA_NUM_THREAD configuration option
    • Environment variable precedence guide
  • Updated .gitignore

    • docker-compose.override.yml for local development
    • docker.env.local for local environment overrides

Ready for deployment with: docker compose up -d

Merge request reports

Loading