railyard/apps/relay/docker-compose.quickstart.yml
caelum0x 56a2ab4252 feat(relay): add quickstart compose and runnable examples
One-key stateless quickstart (OPENAI_API_KEY, optional OpenRouter
failover) plus examples for the OpenAI SDK/curl, fallback routing,
per-key budgets with Postgres metering, and the resale price catalog.
Configs validated with gateway --validate-and-exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 16:44:14 +03:00

37 lines
1.3 KiB
YAML

# Relay quickstart: one gateway, one provider key.
#
# export OPENAI_API_KEY=sk-...
# docker compose -f docker-compose.quickstart.yml up --build
#
# Then call http://localhost:3000/openai/v1/chat/completions with any OpenAI
# SDK (see examples/relay/openai-client). No database, no auth: this is a local
# development setup. For production start from config/tensorzero.toml and the
# Dockerfile, and read docs/deployment/.
#
# Optional:
# OPENROUTER_API_KEY enables the OpenRouter failover leg for gpt-4o-mini.
# RELAY_PORT host port (default 3000).
services:
gateway:
build:
context: .
dockerfile: Dockerfile
image: relay-gateway:local
# Replace the image's production config with the quickstart config.
entrypoint: ["gateway", "--config-file", "/app/quickstart/tensorzero.toml"]
volumes:
- ./config/quickstart:/app/quickstart:ro
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY:?Set OPENAI_API_KEY before running the Relay quickstart}
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY:-}
RUST_LOG: ${RUST_LOG:-info}
ports:
- "${RELAY_PORT:-3000}:3000"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
start_period: 15s
interval: 10s
timeout: 3s
restart: unless-stopped