services:
  tv:
    image: node:22
    working_dir: /app
    volumes:
      - ./tv:/app
      - tv_node_modules:/app/node_modules
    ports:
      - "4173:4173"
    env_file:
      - .env
    command: >
      sh -c "
        npm install -g pnpm --silent &&
        pnpm install &&
        pnpm build &&
        IP=$(hostname -I | awk '{print $1}') &&
        echo \"\" &&
        echo \"==> TV UI available at http://$$IP:4173\" &&
        echo \"\" &&
        pnpm preview --host 0.0.0.0 --port 4173
      "

volumes:
  tv_node_modules:
