services:
  playwright:
    build:
      context: .
      dockerfile: Dockerfile.dev
    volumes:
      # Mount the entire codebase for live development
      - .:/app
      # Preserve node_modules inside the container (avoid host/container conflicts)
      - /app/node_modules
      # Persist test artifacts across runs
      - ./playwright-report:/app/playwright-report
      - ./test-results:/app/test-results
      - ./allure-results:/app/allure-results
      - ./allure-report:/app/allure-report
      # Persist auth state
      - ./playwright/.auth:/app/playwright/.auth
    env_file:
      - .env
    environment:
      - CI=${CI:-false}
    # Keep container running so you can exec into it
    command: tail -f /dev/null
    working_dir: /app
