# mcpgate — Zero-Config Setup
#
# Just run: docker compose up -d
# Then open: http://localhost:8642
#
# The setup wizard guides you through everything.
# Secrets are auto-generated on first start.
# Configuration is persisted in the gateway-data volume.
#
# For advanced configuration, create a .env file (see .env.example).

services:
  mcpgate:
    image: mcpgate/mcpgate:latest
    ports:
      - "8642:3001"
    env_file:
      - path: .env
        required: false
    environment:
      - BASE_URL=http://localhost:8642
      - REDIS_URL=redis://:${REDIS_PASSWORD:-mcpgate-default-pw}@redis:6379/0
    depends_on:
      redis:
        condition: service_healthy
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://localhost:3001/health"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 15s
    volumes:
      - gateway-data:/app/data

  redis:
    image: redis:7-alpine
    command: redis-server --requirepass ${REDIS_PASSWORD:-mcpgate-default-pw} --appendonly yes --maxmemory 128mb --maxmemory-policy allkeys-lru
    volumes:
      - redis-data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-mcpgate-default-pw}", "ping"]
      interval: 5s
      retries: 3
    restart: unless-stopped

volumes:
  gateway-data:
  redis-data:
