-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
219 lines (202 loc) · 5.82 KB
/
docker-compose.yml
File metadata and controls
219 lines (202 loc) · 5.82 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
version: '3.8'
services:
# Enhanced CCany application service with Claude Code support
ccany:
image: czyt/ccany:latest
# Alternative: ghcr.io/ca-x/ccany:latest
# Or build locally:
# build:
# context: .
# dockerfile: Dockerfile
# args:
# VERSION: ${VERSION:-dev}
# BUILD_TIME: ${BUILD_TIME:-unknown}
container_name: ccany-enhanced
ports:
- "8082:8082"
environment:
# OpenAI API Configuration
- OPENAI_API_KEY=${OPENAI_API_KEY}
- OPENAI_BASE_URL=${OPENAI_BASE_URL:-https://api.openai.com/v1}
- AZURE_API_VERSION=${AZURE_API_VERSION}
# Claude API Configuration (for direct Claude support)
- CLAUDE_API_KEY=${CLAUDE_API_KEY}
- CLAUDE_BASE_URL=${CLAUDE_BASE_URL:-https://api.anthropic.com}
# Enhanced Model Configuration
- BIG_MODEL=${BIG_MODEL:-gpt-4o}
- SMALL_MODEL=${SMALL_MODEL:-gpt-4o-mini}
- REASONING_MODEL=${REASONING_MODEL:-gpt-4o}
- LONG_CONTEXT_MODEL=${LONG_CONTEXT_MODEL:-gpt-4o}
# Server Configuration
- HOST=0.0.0.0
- PORT=8082
- LOG_LEVEL=${LOG_LEVEL:-INFO}
# Enhanced Performance Configuration
- MAX_TOKENS_LIMIT=${MAX_TOKENS_LIMIT:-8192}
- MIN_TOKENS_LIMIT=${MIN_TOKENS_LIMIT:-1}
- REQUEST_TIMEOUT=${REQUEST_TIMEOUT:-120}
- MAX_RETRIES=${MAX_RETRIES:-3}
- TEMPERATURE=${TEMPERATURE:-0.7}
- STREAM_ENABLED=${STREAM_ENABLED:-true}
# Database Configuration
- DATABASE_URL=sqlite3:///app/data/ccany.db
- DATABASE_ENCRYPTION_KEY=${DATABASE_ENCRYPTION_KEY:-}
# Security Configuration
- CLAUDE_PROXY_MASTER_KEY=${CLAUDE_PROXY_MASTER_KEY:-}
- JWT_SECRET=${JWT_SECRET:-}
# Claude Code Compatibility
- CLAUDE_CODE_COMPATIBLE=true
- CLAUDE_CONFIG_PATH=/home/appuser/.claude.json
# Monitoring and Logging
- ENABLE_MONITORING=${ENABLE_MONITORING:-true}
- ENABLE_REQUEST_LOGGING=${ENABLE_REQUEST_LOGGING:-true}
- LOG_RETENTION_DAYS=${LOG_RETENTION_DAYS:-30}
volumes:
- ccany_data:/app/data
- ccany_logs:/app/logs
- claude_config:/home/appuser/.claude
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "-O", "/dev/null", "http://localhost:8082/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- ccany-network
depends_on:
- redis
labels:
- "traefik.enable=true"
- "traefik.http.routers.ccany.rule=Host(`ccany.local`)"
- "traefik.http.services.ccany.loadbalancer.server.port=8082"
# Redis for caching and session management
redis:
image: redis:7-alpine
container_name: ccany-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
networks:
- ccany-network
command: ["redis-server", "--appendonly", "yes"]
# Enhanced Nginx reverse proxy with Claude Code optimizations
nginx:
image: nginx:alpine
container_name: ccany-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
- nginx_logs:/var/log/nginx
depends_on:
- ccany
networks:
- ccany-network
profiles:
- nginx
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "-O", "/dev/null", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx.rule=Host(`nginx.local`)"
# Prometheus for monitoring (optional)
prometheus:
image: prom/prometheus:latest
container_name: ccany-prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
networks:
- ccany-network
profiles:
- monitoring
restart: unless-stopped
# Grafana for visualization (optional)
grafana:
image: grafana/grafana:latest
container_name: ccany-grafana
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana:/etc/grafana/provisioning
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
depends_on:
- prometheus
networks:
- ccany-network
profiles:
- monitoring
restart: unless-stopped
# Test service for Claude Code compatibility
test-claude-code:
build:
context: .
dockerfile: Dockerfile
target: builder
container_name: ccany-test
volumes:
- ./tests:/app/tests
command: >
sh -c "
echo 'Running Claude Code compatibility tests...' &&
go test -v ./tests/ &&
echo 'Tests completed successfully!'
"
depends_on:
- ccany
networks:
- ccany-network
profiles:
- test
volumes:
ccany_data:
driver: local
labels:
- "ccany.volume.type=data"
ccany_logs:
driver: local
labels:
- "ccany.volume.type=logs"
claude_config:
driver: local
labels:
- "ccany.volume.type=config"
redis_data:
driver: local
nginx_logs:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
networks:
ccany-network:
driver: bridge
labels:
- "ccany.network.type=main"