-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
224 lines (206 loc) · 6.18 KB
/
docker-compose.test.yml
File metadata and controls
224 lines (206 loc) · 6.18 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
version: '3.8'
services:
# Test Code Intelligence MCP Server
test-code-intelligence:
build:
context: .
dockerfile: Dockerfile.test
container_name: projectara-test-mcp
ports:
- "4000:4000" # REST API
- "8080:8080" # WebSocket/MCP
environment:
- NODE_ENV=test
- LOG_LEVEL=debug
- DATABASE_URL=postgresql://test_user:test_password@test-postgres:5432/projectara_test
- REDIS_URL=redis://test-redis:6379
- STORAGE_BACKEND=postgresql
- CACHE_BACKEND=redis
- TEST_DATA_DIR=/app/test-data
- EXTERNAL_PROJECTS_DIR=/app/external-projects
- TEST_RESULTS_DIR=/app/test-results
- NODE_OPTIONS=--max-old-space-size=3072
- ENABLE_REAL_PROJECT_TESTING=true
- PERFORMANCE_MONITORING=true
volumes:
# Main application code
- ./typescript-mcp/src:/app/src
- ./typescript-mcp/dist:/app/dist
- ./typescript-mcp/package.json:/app/package.json
- ./typescript-mcp/tsconfig.json:/app/tsconfig.json
# External GitHub projects (read-only)
- ./external-test-projects:/app/external-projects:ro
# Test data and results
- ./test-data:/app/test-data
- ./test-results:/app/test-results
- ./project-stats:/app/project-stats
- ./coverage-reports:/app/coverage-reports
# Scripts
- ./scripts:/app/scripts:ro
depends_on:
test-postgres:
condition: service_healthy
test-redis:
condition: service_healthy
restart: unless-stopped
networks:
- projectara-test-network
# Health check for the test server
healthcheck:
test: ["CMD", "node", "dist/health-check.js"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Resource limits for testing
mem_limit: 4g
memswap_limit: 4g
cpus: 2.0
# Test PostgreSQL Database with pgvector
test-postgres:
image: pgvector/pgvector:pg16
container_name: projectara-test-postgres
ports:
- "5433:5432" # Different port to avoid conflicts
environment:
- POSTGRES_DB=projectara_test
- POSTGRES_USER=test_user
- POSTGRES_PASSWORD=test_password
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
volumes:
- test_postgres_data:/var/lib/postgresql/data
- ./docker/postgres/test-init.sql:/docker-entrypoint-initdb.d/test-init.sql:ro
restart: unless-stopped
networks:
- projectara-test-network
# Health check
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test_user -d projectara_test"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Test Redis Cache
test-redis:
image: redis:7-alpine
container_name: projectara-test-redis
ports:
- "6380:6379" # Different port to avoid conflicts
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- test_redis_data:/data
restart: unless-stopped
networks:
- projectara-test-network
# Health check
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
# Test Prometheus for monitoring
test-prometheus:
image: prom/prometheus:latest
container_name: projectara-test-prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=24h' # Shorter retention for tests
- '--web.enable-lifecycle'
volumes:
- ./docker/prometheus/test-prometheus.yml:/etc/prometheus/prometheus.yml:ro
- test_prometheus_data:/prometheus
ports:
- "9092:9090" # Different port to avoid conflicts
restart: unless-stopped
networks:
- projectara-test-network
profiles:
- monitoring
# Test Grafana for dashboards
test-grafana:
image: grafana/grafana:latest
container_name: projectara-test-grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=test_admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
volumes:
- test_grafana_data:/var/lib/grafana
- ./docker/grafana/test-provisioning:/etc/grafana/provisioning:ro
- ./docker/grafana/test-dashboards:/var/lib/grafana/dashboards:ro
ports:
- "4002:3000" # Different port to avoid conflicts (internal Grafana port is 3000)
restart: unless-stopped
networks:
- projectara-test-network
profiles:
- monitoring
depends_on:
- test-prometheus
# Test Ollama for LLM (optional)
test-ollama:
image: ollama/ollama:latest
container_name: projectara-test-ollama
volumes:
- test_ollama_data:/root/.ollama
ports:
- "11434:11434"
restart: unless-stopped
networks:
- projectara-test-network
profiles:
- llm
environment:
- OLLAMA_HOST=0.0.0.0
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Test Runner Service
test-runner:
build:
context: .
dockerfile: Dockerfile.test
container_name: projectara-test-runner
environment:
- NODE_ENV=test
- DATABASE_URL=postgresql://test_user:test_password@test-postgres:5432/projectara_test
- REDIS_URL=redis://test-redis:6379
- MCP_SERVER_URL=http://test-code-intelligence:4000
- WEBSOCKET_URL=ws://test-code-intelligence:8080
volumes:
- ./scripts:/app/scripts:ro
- ./test-results:/app/test-results
- ./external-test-projects:/app/external-projects:ro
depends_on:
test-code-intelligence:
condition: service_healthy
networks:
- projectara-test-network
profiles:
- test-runner
command: ["npm", "run", "test:all"]
# Test-specific volumes
volumes:
test_postgres_data:
driver: local
test_redis_data:
driver: local
test_prometheus_data:
driver: local
test_grafana_data:
driver: local
test_ollama_data:
driver: local
# Isolated test network
networks:
projectara-test-network:
driver: bridge
ipam:
config:
- subnet: 172.21.0.0/16
gateway: 172.21.0.1