# ═══════════════════════════════════════════════════
# Google Alerts Reporter - Docker Compose
# ═══════════════════════════════════════════════════

version: '3.8'

services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: alerts-reporter-web
    image: alerts-reporter:latest

    ports:
      - "8000:8000"

    environment:
      - DEBUG=false
      - HOST=0.0.0.0
      - PORT=8000

    env_file:
      - .env

    volumes:
      # Persistent data
      - ./reports:/app/reports
      - ./logs:/app/logs

      # Gmail credentials (mount from host)
      - ../credentials.json:/app/credentials.json:ro
      - ../token.json:/app/token.json

    restart: unless-stopped

    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

    networks:
      - alerts-network

    labels:
      - "com.alerts-reporter.description=Google Alerts Reporter Web UI"
      - "com.alerts-reporter.version=2.0.0"

networks:
  alerts-network:
    driver: bridge
