version: '3.8'

services:
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: claude-monitor-backend
    ports:
      - "8000:8000"
    volumes:
      - ./data:/app/data
    environment:
      - DATABASE_URL=sqlite:///./data/claude_monitor.db
      - CORS_ORIGINS=*
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    networks:
      - claude-monitor

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    container_name: claude-monitor-frontend
    ports:
      - "3000:80"
    depends_on:
      - backend
    restart: unless-stopped
    networks:
      - claude-monitor

networks:
  claude-monitor:
    driver: bridge

volumes:
  data:
