# Local development stack: TTS router + web app, with hot reload. # # docker compose up # # The database is a single SQLite file on a named volume (shared by the migrate # one-shot and the web app). Source is mounted for live reload; deps live in an # image-owned volume so the host's node_modules never shadows them. The # `migrate` one-shot applies the schema and seeds models before web comes up. # # Secrets come from two files you fill in (both gitignored): # .env — compose-level (ports, router key) # .env.development.local — app secrets (HF OAuth, provider API keys) name: tts-arena services: # One-shot: apply migrations and seed the model registry, then exit. migrate: image: oven/bun:1.1.42 working_dir: /app environment: SQLITE_PATH: /data/tts_arena.db volumes: - .:/app - web-node-modules:/app/node_modules - db-data:/data command: > sh -c "apt-get update && apt-get install -y --no-install-recommends python3 make g++ >/dev/null 2>&1; bun install && cd apps/web && bunx drizzle-kit migrate && bun run src/server/db/seed.ts" router: image: oven/bun:1.1.42 working_dir: /app restart: unless-stopped env_file: - .env.development.local environment: PORT: "8080" ROUTER_API_KEY: ${ROUTER_API_KEY:-} ports: - "${ROUTER_PORT:-8080}:8080" volumes: - .:/app - router-node-modules:/app/node_modules command: > sh -c "apt-get update && apt-get install -y --no-install-recommends ffmpeg >/dev/null 2>&1; bun install && bun --watch apps/router/src/index.ts" web: image: oven/bun:1.1.42 working_dir: /app restart: unless-stopped depends_on: migrate: condition: service_completed_successfully env_file: - .env.development.local environment: SQLITE_PATH: /data/tts_arena.db ROUTER_URL: http://router:8080 ROUTER_API_KEY: ${ROUTER_API_KEY:-} APP_URL: ${APP_URL:-http://localhost:3000} PORT: "3000" AUDIO_CACHE_DIR: /audio-cache AUDIO_LOG_DIR: /audio ports: - "${WEB_PORT:-3000}:3000" volumes: - .:/app - web-node-modules:/app/node_modules - web-next:/app/apps/web/.next - db-data:/data - web-audio-cache:/audio-cache - web-audio-log:/audio command: > sh -c "apt-get update && apt-get install -y --no-install-recommends python3 make g++ >/dev/null 2>&1; bun install && cd apps/web && bun run dev --hostname 0.0.0.0 --port 3000" volumes: db-data: web-node-modules: router-node-modules: web-next: web-audio-log: web-audio-cache: