-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.microservices.yml
More file actions
263 lines (251 loc) · 6.71 KB
/
Copy pathdocker-compose.microservices.yml
File metadata and controls
263 lines (251 loc) · 6.71 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
version: '3.8'
services:
# API Gateway - Single entry point
api-gateway:
build: ./services/api-gateway
container_name: testmgr-api-gateway
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- PORT=3000
- USER_ADMIN_URL=http://user-admin:4001
- AGILE_BOARD_URL=http://agile-board:4002
- CODE_TRACER_URL=http://code-tracer:4003
- PIPELINE_URL=http://pipeline:4004
- TEST_MGMT_URL=http://test-mgmt:4005
- REPORTING_URL=http://reporting:4006
- JWT_SECRET=${JWT_SECRET:-dev-secret-key}
depends_on:
- user-admin
- agile-board
- code-tracer
- pipeline
- test-mgmt
- reporting
- redis
networks:
- testmgr-network
restart: unless-stopped
# User Admin Service - Authentication & Authorization
user-admin:
build: ./services/user-admin
container_name: testmgr-user-admin
ports:
- "4001:4001"
environment:
- NODE_ENV=development
- PORT=4001
- SERVICE_NAME=user-admin
- DATABASE_URL=${DATABASE_URL:-postgresql://testmgr:testmgr@postgres:5432/testmgr_users}
- REDIS_URL=redis://redis:6379
- JWT_SECRET=${JWT_SECRET:-dev-secret-key}
volumes:
- ./data/user-admin:/data
- ./logs/user-admin:/logs
depends_on:
- postgres
- redis
networks:
- testmgr-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4001/health"]
interval: 30s
timeout: 10s
retries: 3
# Agile Board Service - Boards, Sprints, Stories
agile-board:
build: ./services/agile-board
container_name: testmgr-agile-board
ports:
- "4002:4002"
environment:
- NODE_ENV=development
- PORT=4002
- SERVICE_NAME=agile-board
- DATABASE_URL=${DATABASE_URL:-postgresql://testmgr:testmgr@postgres:5432/testmgr_agile}
- REDIS_URL=redis://redis:6379
volumes:
- ./data/agile-board:/data
- ./logs/agile-board:/logs
depends_on:
- postgres
- redis
networks:
- testmgr-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4002/health"]
interval: 30s
timeout: 10s
retries: 3
# Code Tracer Service - Code traceability & change detection
code-tracer:
build: ./services/code-tracer
container_name: testmgr-code-tracer
ports:
- "4003:4003"
environment:
- NODE_ENV=development
- PORT=4003
- SERVICE_NAME=code-tracer
- DATABASE_URL=${DATABASE_URL:-postgresql://testmgr:testmgr@postgres:5432/testmgr_code}
- REDIS_URL=redis://redis:6379
volumes:
- ./data/code-tracer:/data
- ./logs/code-tracer:/logs
- ${CODE_REPO_PATH:-./repos}:/repos:ro # Read-only access to repositories
depends_on:
- postgres
- redis
networks:
- testmgr-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4003/health"]
interval: 30s
timeout: 10s
retries: 3
# Pipeline Service - CI/CD & GitOps
pipeline:
build: ./services/pipeline
container_name: testmgr-pipeline
ports:
- "4004:4004"
environment:
- NODE_ENV=development
- PORT=4004
- SERVICE_NAME=pipeline
- DATABASE_URL=${DATABASE_URL:-postgresql://testmgr:testmgr@postgres:5432/testmgr_pipeline}
- REDIS_URL=redis://redis:6379
- GIT_TOKEN=${GIT_TOKEN:-}
volumes:
- ./data/pipeline:/data
- ./logs/pipeline:/logs
depends_on:
- postgres
- redis
networks:
- testmgr-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4004/health"]
interval: 30s
timeout: 10s
retries: 3
# Test Management Service - Tests, Defects, Issues
test-mgmt:
build: ./services/test-mgmt
container_name: testmgr-test-mgmt
ports:
- "4005:4005"
environment:
- NODE_ENV=development
- PORT=4005
- SERVICE_NAME=test-mgmt
- DATABASE_URL=${DATABASE_URL:-postgresql://testmgr:testmgr@postgres:5432/testmgr_tests}
- REDIS_URL=redis://redis:6379
volumes:
- ./data/test-mgmt:/data
- ./logs/test-mgmt:/logs
- ./test-results:/test-results
depends_on:
- postgres
- redis
networks:
- testmgr-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4005/health"]
interval: 30s
timeout: 10s
retries: 3
# Reporting Service - Dashboards & Metrics
reporting:
build: ./services/reporting
container_name: testmgr-reporting
ports:
- "4006:4006"
environment:
- NODE_ENV=development
- PORT=4006
- SERVICE_NAME=reporting
- DATABASE_URL=${DATABASE_URL:-postgresql://testmgr:testmgr@postgres:5432/testmgr_reports}
- REDIS_URL=redis://redis:6379
volumes:
- ./data/reporting:/data
- ./logs/reporting:/logs
- ./reports:/reports
depends_on:
- postgres
- redis
networks:
- testmgr-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4006/health"]
interval: 30s
timeout: 10s
retries: 3
# Redis - Event bus & caching
redis:
image: redis:7-alpine
container_name: testmgr-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- testmgr-network
restart: unless-stopped
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# PostgreSQL - Persistent data storage
postgres:
image: postgres:15-alpine
container_name: testmgr-postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=testmgr
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-testmgr}
- POSTGRES_DB=testmgr
volumes:
- postgres-data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- testmgr-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U testmgr"]
interval: 30s
timeout: 10s
retries: 3
# Nginx - Load balancer (optional, for production)
# nginx:
# image: nginx:alpine
# container_name: testmgr-nginx
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
# - ./nginx/ssl:/etc/nginx/ssl:ro
# depends_on:
# - api-gateway
# networks:
# - testmgr-network
# restart: unless-stopped
networks:
testmgr-network:
driver: bridge
volumes:
postgres-data:
driver: local
redis-data:
driver: local