-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
231 lines (212 loc) · 6.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
231 lines (212 loc) · 6.7 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
220
221
222
223
224
225
226
227
228
229
230
231
services:
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: council-postgres
environment:
POSTGRES_USER: ${DATABASE_USER:-postgres}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-postgres}
POSTGRES_DB: ${DATABASE_NAME:-ai_council_proxy}
ports:
- "${DATABASE_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- council-network
# PostgreSQL Test Database (for running integration tests)
postgres-test:
image: postgres:16-alpine
container_name: council-postgres-test
environment:
POSTGRES_USER: ${TEST_DATABASE_USER:-postgres}
POSTGRES_PASSWORD: ${TEST_DATABASE_PASSWORD:-postgres}
POSTGRES_DB: ${TEST_DATABASE_NAME:-ai_council_test}
ports:
- "${TEST_DATABASE_PORT:-5433}:5432"
volumes:
- postgres_test_data:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${TEST_DATABASE_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- council-network
profiles:
- test
# Redis Cache
redis:
image: redis:7-alpine
container_name: council-redis
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- council-network
# AI Council Proxy API
api:
build:
context: .
dockerfile: Dockerfile
container_name: council-api
environment:
NODE_ENV: ${NODE_ENV:-production}
# Database
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_NAME: ${DATABASE_NAME:-ai_council_proxy}
DATABASE_USER: ${DATABASE_USER:-postgres}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-postgres}
DATABASE_URL: postgresql://${DATABASE_USER:-postgres}:${DATABASE_PASSWORD:-postgres}@postgres:5432/${DATABASE_NAME:-ai_council_proxy}
# Redis
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_URL: redis://redis:6379
# API Configuration
API_PORT: ${API_PORT:-3000}
API_HOST: ${API_HOST:-0.0.0.0}
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
ADMIN_API_TOKEN: ${ADMIN_API_TOKEN:?ADMIN_API_TOKEN is required}
# Provider API Keys (required)
OPENAI_API_KEY: ${OPENAI_API_KEY}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
GOOGLE_API_KEY: ${GOOGLE_API_KEY}
XAI_API_KEY: ${XAI_API_KEY}
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY}
ARTIFICIAL_ANALYSIS_API_KEY: ${ARTIFICIAL_ANALYSIS_API_KEY:-}
# Session Configuration
SESSION_TIMEOUT_MS: ${SESSION_TIMEOUT_MS:-1800000}
SESSION_MAX_CONTEXT_TOKENS: ${SESSION_MAX_CONTEXT_TOKENS:-4000}
# Performance Configuration
GLOBAL_TIMEOUT_SECONDS: ${GLOBAL_TIMEOUT_SECONDS:-60}
ENABLE_STREAMING: ${ENABLE_STREAMING:-true}
# Cost Tracking
COST_ALERT_THRESHOLD: ${COST_ALERT_THRESHOLD:-100.00}
COST_CURRENCY: ${COST_CURRENCY:-USD}
ports:
- "${API_PORT:-3000}:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
networks:
- council-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# AI Council Proxy UI - DISABLED (use Admin GUI at :3001 instead)
# ui:
# build:
# context: .
# dockerfile: Dockerfile.ui
# container_name: council-ui
# environment:
# NODE_ENV: ${NODE_ENV:-production}
# DATABASE_HOST: postgres
# DATABASE_PORT: 5432
# DATABASE_NAME: ${DATABASE_NAME:-ai_council_proxy}
# DATABASE_USER: ${DATABASE_USER:-postgres}
# DATABASE_PASSWORD: ${DATABASE_PASSWORD:-postgres}
# DATABASE_URL: postgresql://${DATABASE_USER:-postgres}:${DATABASE_PASSWORD:-postgres}@postgres:5432/${DATABASE_NAME:-ai_council_proxy}
# REDIS_HOST: redis
# REDIS_PORT: 6379
# REDIS_URL: redis://redis:6379
# UI_PORT: ${UI_PORT:-8080}
# API_BASE_URL: ${API_BASE_URL}
# ports:
# - "${UI_PORT:-8080}:8080"
# depends_on:
# postgres:
# condition: service_healthy
# redis:
# condition: service_healthy
# api:
# condition: service_healthy
# restart: unless-stopped
# networks:
# - council-network
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:8080/"]
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 40s
# Admin Dashboard (Primary GUI - port 3001)
admin:
build:
context: .
dockerfile: Dockerfile.admin
container_name: council-admin
environment:
NODE_ENV: ${NODE_ENV:-production}
# Database
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_NAME: ${DATABASE_NAME:-ai_council_proxy}
DATABASE_USER: ${DATABASE_USER:-postgres}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-postgres}
DATABASE_URL: postgresql://${DATABASE_USER:-postgres}:${DATABASE_PASSWORD:-postgres}@postgres:5432/${DATABASE_NAME:-ai_council_proxy}
# Redis
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_URL: redis://redis:6379
# Admin Configuration
ADMIN_PORT: ${ADMIN_PORT:-3001}
# API Gateway connection (for proxying /api/v1/* requests)
API_INTERNAL_HOST: api
API_PORT: 3000
ADMIN_API_TOKEN: ${ADMIN_API_TOKEN:?ADMIN_API_TOKEN is required}
# Provider API Keys (for health checks)
OPENAI_API_KEY: ${OPENAI_API_KEY}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
GOOGLE_API_KEY: ${GOOGLE_API_KEY}
XAI_API_KEY: ${XAI_API_KEY}
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY}
ARTIFICIAL_ANALYSIS_API_KEY: ${ARTIFICIAL_ANALYSIS_API_KEY:-}
ports:
- "${ADMIN_PORT:-3001}:3001"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
api:
condition: service_healthy
restart: unless-stopped
networks:
- council-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres_data:
driver: local
postgres_test_data:
driver: local
redis_data:
driver: local
networks:
council-network:
driver: bridge