mermaid-cli 0.2.0

Open-source AI pair programmer with agentic capabilities. Local-first with Ollama, native tool calling, and beautiful TUI.
Documentation
version: "3.9"
services:
  litellm:
    image: ghcr.io/berriai/litellm:main-stable
    container_name: mermaid-litellm
    networks:
      - litellm-network
    ports:
      - "127.0.0.1:4000:4000"  # Bind to localhost only for security
    extra_hosts:
      - "host.containers.internal:host-gateway"  # Podman-specific host access
    environment:
      LITELLM_MASTER_KEY: "${LITELLM_MASTER_KEY}"
      DATABASE_URL: "postgresql://mermaid:${POSTGRES_PASSWORD:-changeme}@db:5432/litellm"
      STORE_MODEL_IN_DB: "True"
      # Ollama configuration - use host.containers.internal for Podman rootless
      OLLAMA_API_BASE: "${OLLAMA_API_BASE:-http://host.containers.internal:11434}"
      # Pass through API keys from host environment
      OPENAI_API_KEY: "${OPENAI_API_KEY:-}"
      ANTHROPIC_API_KEY: "${ANTHROPIC_API_KEY:-}"
      GROQ_API_KEY: "${GROQ_API_KEY:-}"
      GOOGLE_API_KEY: "${GOOGLE_API_KEY:-}"
      AZURE_API_KEY: "${AZURE_API_KEY:-}"
    volumes:
      - ./litellm_config.yaml:/app/config.yaml:z  # :z for SELinux/Podman compatibility
    command: ["--config=/app/config.yaml", "--detailed_debug"]
    depends_on:
      db:
        condition: service_healthy
    restart: unless-stopped
    security_opt:
      - label=disable  # For rootless podman compatibility
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - NET_BIND_SERVICE

  db:
    image: docker.io/library/postgres:16-alpine  # Fully qualified for Podman
    container_name: mermaid-postgres
    environment:
      POSTGRES_DB: litellm
      POSTGRES_USER: mermaid
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-changeme}"
    volumes:
      - litellm_data:/var/lib/postgresql/data:z
    ports:
      - "127.0.0.1:5433:5432"  # Bind to localhost only, avoid conflicts
    restart: unless-stopped
    security_opt:
      - label=disable
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - DAC_OVERRIDE
      - FOWNER
      - SETGID
      - SETUID
    networks:
      - litellm-network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U mermaid"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 10s

  searxng:
    image: docker.io/searxng/searxng:latest
    container_name: mermaid-searxng
    networks:
      - litellm-network
    ports:
      - "127.0.0.1:8888:8080"  # Bind to localhost only for security
    volumes:
      - ./searxng:/etc/searxng:z  # :z for SELinux/Podman compatibility
    environment:
      SEARXNG_BASE_URL: "http://localhost:8888/"
      SEARXNG_SECRET: "${SEARXNG_SECRET:-change-me-please}"
    restart: unless-stopped
    security_opt:
      - label=disable  # For rootless podman compatibility
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - NET_BIND_SERVICE

volumes:
  litellm_data:
    name: mermaid_litellm_data

networks:
  litellm-network:
    name: mermaid_network
    driver: bridge