-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
108 lines (103 loc) · 2.61 KB
/
docker-compose.prod.yml
File metadata and controls
108 lines (103 loc) · 2.61 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
version: '3.8'
services:
claude-proxy:
image: ${DOCKER_REGISTRY}/claude-proxy:${VERSION:-latest}
container_name: claude-proxy-prod
ports:
- "54988:54988"
volumes:
- /data/claude-proxy:/app/data
- /var/log/claude-proxy:/app/logs
environment:
- PORT=54988
- HOST=0.0.0.0
- LOG_LEVEL=INFO
- DB_PATH=/app/data/proxy.db
# Load Balancer Configuration
- LB_HEALTH_CHECK_INTERVAL=30
- LB_FAILURE_THRESHOLD=3
- LB_RECOVERY_THRESHOLD=2
- LB_MAX_RETRIES=3
- LB_CIRCUIT_BREAKER_ENABLED=true
- LB_ERROR_RATE_THRESHOLD=0.5
restart: always
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:54988/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
- claude-network
deploy:
mode: replicated
replicas: 2
resources:
limits:
cpus: '4'
memory: 2G
reservations:
cpus: '2'
memory: 1G
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
update_config:
parallelism: 1
delay: 10s
failure_action: rollback
monitor: 60s
order: start-first
rollback_config:
parallelism: 1
delay: 5s
failure_action: pause
monitor: 60s
order: stop-first
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
labels: "service=claude-proxy"
# Optional: Prometheus for monitoring
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
networks:
- claude-network
restart: unless-stopped
# Optional: Grafana for visualization
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
networks:
- claude-network
restart: unless-stopped
depends_on:
- prometheus
networks:
claude-network:
driver: bridge
volumes:
prometheus-data:
grafana-data: