services:
  claude-code:
    image: node:20-slim
    container_name: claude_code
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
      - GH_TOKEN=${GH_TOKEN}
      - DEVCONTAINER=true
      - NODE_OPTIONS=--max-old-space-size=4096
      - TZ=Asia/Tokyo
      - LANG=C.UTF-8
    volumes:
      - /volume1/docker/match_12:/workspace/match_12
      - ./tasks:/tasks:ro
      - ./logs:/logs
      - ./scripts:/scripts:ro
      - ./install-superpowers.sh:/scripts/install-superpowers.sh:ro
      - claude_config:/home/node/.claude
    working_dir: /workspace/match_12
    restart: unless-stopped
    command: ["bash", "-c", "apt-get update && apt-get install -y git curl jq sudo > /dev/null 2>&1 && npm install -g @anthropic-ai/claude-code > /dev/null 2>&1 && echo 'node ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && bash /scripts/install-superpowers.sh && echo Claude Code ready && sleep infinity"]

volumes:
  claude_config:
