version: '3.8'

services:
  # WhatsApp Bridge (Go/whatsmeow)
  whatsapp-bridge:
    build:
      context: ./services/whatsapp-bridge
      dockerfile: Dockerfile
    container_name: parrot-whatsapp-bridge
    ports:
      - "8765:8765"
    volumes:
      - ./data/whatsapp:/app/data
    environment:
      # Connect to the host's Redis server
      - REDIS_URL=redis://host.docker.internal:6379
      - BRIDGE_PORT=8765
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    healthcheck:
      test: [ "CMD", "wget", "--spider", "-q", "http://localhost:8765/health" ]
      interval: 30s
      timeout: 10s
      retries: 3
