-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (60 loc) · 1.88 KB
/
Copy pathdocker-compose.yml
File metadata and controls
62 lines (60 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
services:
opencode-proxy:
build: .
# Internal only — Headroom connects via Docker network.
# Not exposed on host; clients use Headroom:8787 instead.
# To access the proxy directly (bypassing Headroom), add:
# ports:
# - "8080:8080"
env_file: .env
ports:
- "8080:8080"
depends_on:
headroom:
condition: service_healthy
required: false # Headroom is opt-in; proxy starts without it
restart: unless-stopped
# Headroom compression proxy — public entry point on port 8787.
# Flow: Client → Headroom:8787 → opencode-proxy:8080 → upstream
# Configure your client: ANTHROPIC_BASE_URL=http://localhost:8787
headroom:
build:
context: .
dockerfile: Dockerfile.headroom
ports:
- "8787:8787"
command:
[
"--host",
"0.0.0.0",
"--port",
"8787",
"--memory",
"--memory-db-path",
"/data/headroom.db",
"--code-aware",
"--intercept-tool-results",
]
environment:
- ANTHROPIC_TARGET_API_URL=http://opencode-proxy:8080
- ANTHROPIC_API_KEY=${OPENCODE_API_KEY}
- OPENAI_TARGET_API_URL=http://opencode-proxy:8080/v1
- OPENAI_API_KEY=${OPENCODE_API_KEY}
- HEADROOM_TELEMETRY=off
# ── Compression tuning (aggressive) ──────────────────────────────────
- HEADROOM_COMPRESSION_STABLE_AFTER_TURN=1
- HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS=1
- HEADROOM_COMPRESS_USER_MESSAGES=true
- HEADROOM_COMPRESS_SYSTEM_MESSAGES=true
- HEADROOM_MIN_TOKENS=50
volumes:
- headroom-data:/data
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8787/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
volumes:
headroom-data: