-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (44 loc) · 1.67 KB
/
Copy pathdocker-compose.yml
File metadata and controls
44 lines (44 loc) · 1.67 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
services:
llm-relay:
build:
context: .
dockerfile: Dockerfile
container_name: llm-relay
restart: unless-stopped
ports:
- "127.0.0.1:8080:8080" # Claude Code: ANTHROPIC_BASE_URL=http://localhost:8080
- "127.0.0.1:8082:8080" # Legacy compat
# - "<YOUR_TAILSCALE_IP>:8080:8080" # Optional: bind to Tailscale IP for remote access
volumes:
- ${HOME}/.llm-relay:/data/legacy # Usage DB
# Claude Code transcript JSONL (read-only, for display page last-user-prompt)
- ${HOME}/.claude/projects:/data/claude-projects:ro
- /proc:/host/proc:ro # Host process inspection (display page liveness check)
# 2-tier env: .env.public (defaults) + .env.local (optional overrides)
env_file:
- .env.public
- path: .env.local
required: false
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
# Docker-only overrides (container-internal paths)
# LLM_RELAY_DB: env_file sets localhost which won't work inside container.
# .env.local should set LLM_RELAY_DOCKER_DB with host.docker.internal for container use.
- LLM_RELAY_DB=${LLM_RELAY_DOCKER_DB:-${LLM_RELAY_DB:-/data/legacy/usage.db}}
- LLM_RELAY_PORT=8080
- LLM_RELAY_WARN_RATIO=50.0
- LLM_RELAY_CLAUDE_PROJECTS_DIR=/data/claude-projects
- LLM_RELAY_HOST_PROC=/host/proc
mem_limit: 256m
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/_health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"