services:
  api:
    image: usa-dashboard-api:latest
    build:
      context: .
      args:
        - VITE_MAPBOX_ACCESS_TOKEN=${VITE_MAPBOX_ACCESS_TOKEN:-}
    ports:
      - "3001:3001"
    environment:
      - DB_PATH=/data/data.db
      - API_PORT=3001
    volumes:
      - app-data:/data
    restart: unless-stopped

  crawler:
    image: usa-dashboard-crawler:latest
    build:
      context: .
      dockerfile: Dockerfile.crawler
    environment:
      - DB_PATH=/data/data.db
      - API_BASE=http://api:3001
      - GDELT_DISABLED=1
      - RSS_INTERVAL_SEC=60
      - DASHSCOPE_API_KEY=${DASHSCOPE_API_KEY:-}
    volumes:
      - app-data:/data
    depends_on:
      - api
    restart: unless-stopped

volumes:
  app-data:
