# BaraDB — Development Docker Compose
# Usage: docker compose up -d

services:
  baradb:
    build:
      context: .
      dockerfile: Dockerfile
    image: baradb:latest
    container_name: baradb-dev
    hostname: baradb
    restart: unless-stopped

    ports:
      - "9472:9472"   # Binary protocol
      - "9912:9912"   # HTTP/REST API
      - "9913:9913"   # WebSocket

    volumes:
      - baradb_data:/data
      # Монтираме WAL директорията отделно за по-добра производителност (по желание)
      # - baradb_wal:/data/server/wal

    environment:
      - BARADB_ADDRESS=0.0.0.0
      - BARADB_PORT=9472
      - BARADB_DATA_DIR=/data
      - BARADB_LOG_LEVEL=debug

    healthcheck:
      test: ["CMD", "sh", "-c", "wget -qO- http://localhost:9912/health >/dev/null 2>&1"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 15s

    # Development resource limits (по-леки)
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 2G
        reservations:
          cpus: '0.5'
          memory: 256M

    networks:
      - baradb_net

volumes:
  baradb_data:
    driver: local

networks:
  baradb_net:
    driver: bridge
