- Add /api/data/export endpoint to worker-api for data export - Create cmd/acb-indexer/ TypeScript container: - API client for fetching data from Worker API - Index generator for leaderboard, bot profiles, match index - File writer for outputting JSON files - Optional Cloudflare Pages deploy support - Unit tests (6 tests) - Update PROGRESS.md to mark Phase 4 complete Phase 4 is now complete. All exit criteria met: - Matchmaker cron creates jobs in D1 - Workers claim and execute matches - Replays land in R2 - Results flow into D1 - Ratings update via Glicko-2 - Leaderboard.json rebuilds automatically - Stale job reaper recovers from worker disappearance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
728 B
Docker
33 lines
728 B
Docker
# AI Code Battle Index Builder Container
|
|
# Generates static JSON index files and deploys to Cloudflare Pages
|
|
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci --only=production
|
|
|
|
# Copy source code
|
|
COPY tsconfig.json ./
|
|
COPY src/ ./src/
|
|
|
|
# Build TypeScript
|
|
RUN npm run build
|
|
|
|
# Create output directory
|
|
RUN mkdir -p /app/data
|
|
|
|
# Environment variables (set at runtime)
|
|
# API_URL - Worker API URL (e.g., https://api.aicodebattle.com)
|
|
# API_KEY - Worker API key
|
|
# OUTPUT_DIR - Output directory (default: /app/data)
|
|
# DEPLOY_COMMAND - Optional deploy command (e.g., wrangler pages deploy)
|
|
|
|
ENV OUTPUT_DIR=/app/data
|
|
|
|
# Run the index builder
|
|
CMD ["node", "dist/index.js"]
|