services:
  portfolio:
    build: .
    container_name: pythagoras-portfolio
    restart: unless-stopped
    command: ["uv", "run", "python", "-m", "src.portfolio.runner"]
    volumes:
      - ./data:/app/data
      - ./portfolios.yml:/app/portfolios.yml:ro
    env_file:
      - .env
    environment:
      - PYTHONUNBUFFERED=1
    healthcheck:
      test: ["CMD", "python", "-c", "import os; assert any(f.endswith('status.json') for r,d,fs in os.walk('/app/data/portfolios') for f in fs)"]
      interval: 120s
      timeout: 10s
      retries: 3
    labels:
      - com.centurylinklabs.watchtower.enable=false
