services:
  media-api:
    build:
      context: .
      dockerfile: Dockerfile.api
    container_name: media-api
    restart: unless-stopped
    volumes:
      - /media/yusiboyz/Media/Audiobooks:/audiobooks:ro
    environment:
      - DATABASE_URL=postgresql+asyncpg://brain:brain@brain-db:5432/brain
      - REDIS_URL=redis://brain-redis:6379/0
      - LOCAL_AUDIO_PATH=/audiobooks
      - PORT=8400
      - TZ=${TZ:-America/Chicago}
    networks:
      - default
      - pangolin
      - brain

  media-worker:
    build:
      context: .
      dockerfile: Dockerfile.worker
    container_name: media-worker
    restart: unless-stopped
    volumes:
      - /media/yusiboyz/Media/Audiobooks:/audiobooks:ro
    environment:
      - DATABASE_URL=postgresql+asyncpg://brain:brain@brain-db:5432/brain
      - REDIS_URL=redis://brain-redis:6379/0
      - LOCAL_AUDIO_PATH=/audiobooks
      - FEED_FETCH_INTERVAL=1800
      - TZ=${TZ:-America/Chicago}
    networks:
      - default
      - brain

networks:
  pangolin:
    external: true
  brain:
    name: brain_default
    external: true
