-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
255 lines (241 loc) · 7.45 KB
/
docker-compose.yml
File metadata and controls
255 lines (241 loc) · 7.45 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
# Production docker-compose using GitHub Container Registry images
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:13
container_name: flexfit-db
environment:
- POSTGRES_DB=flexfit
- POSTGRES_USER=flexfit
- POSTGRES_PASSWORD=${DB_PASSWORD:-flexfit123}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- flexfit-network
restart: unless-stopped
# Eureka Service Registry
service-registry:
image: ghcr.io/aet-devops25/team-code-compass/service-registry:${IMAGE_TAG:-latest}
container_name: flexfit-service-registry
ports:
- "8761:8761"
networks:
- flexfit-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8761/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
# API Gateway
api-gateway:
image: ghcr.io/aet-devops25/team-code-compass/api-gateway:${IMAGE_TAG:-latest}
container_name: flexfit-api-gateway
ports:
- "8080:8000"
depends_on:
- service-registry
networks:
- flexfit-network
environment:
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://service-registry:8761/eureka
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
# User Service
user-service:
image: ghcr.io/aet-devops25/team-code-compass/user-service:${IMAGE_TAG:-latest}
container_name: flexfit-user-service
depends_on:
- db
- service-registry
networks:
- flexfit-network
environment:
- SPRING_DATASOURCE_URL=${POSTGRES_URL:-jdbc:postgresql://db:5432/flexfit}
- SPRING_DATASOURCE_USERNAME=${POSTGRES_USER:-flexfit}
- SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-flexfit123}
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://service-registry:8761/eureka
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
# Workout Plan Service
workout-plan-service:
image: ghcr.io/aet-devops25/team-code-compass/workout-plan-service:${IMAGE_TAG:-latest}
container_name: flexfit-workout-plan-service
depends_on:
- db
- service-registry
networks:
- flexfit-network
environment:
- SPRING_PROFILES_ACTIVE=docker
- SPRING_DATASOURCE_URL=${POSTGRES_URL:-jdbc:postgresql://db:5432/flexfit}
- SPRING_DATASOURCE_USERNAME=${POSTGRES_USER:-flexfit}
- SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-flexfit123}
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://service-registry:8761/eureka
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
# TTS Service
tts-service:
build: ./server/tts-service
container_name: flexfit-tts-service
ports:
- "8083:8083"
depends_on:
- service-registry
networks:
- flexfit-network
environment:
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://service-registry:8761/eureka
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083/api/tts/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
# GenAI Workout Worker (Cloud - Open WebUI)
genai-workout-worker:
image: ghcr.io/aet-devops25/team-code-compass/genai-worker:${IMAGE_TAG:-latest}
container_name: flexfit-genai-worker
ports:
- "8084:8000"
networks:
- flexfit-network
environment:
- OPEN_WEBUI_BASE_URL=${OPEN_WEBUI_BASE_URL:-https://gpu.aet.cit.tum.de}
- CHAIR_API_KEY=${CHAIR_API_KEY}
- MODEL_NAME=${MODEL_NAME:-llama3.3:latest}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
# GenAI Workout Worker (Local - GPT4All/Ollama)
genai-workout-worker-local:
image: ghcr.io/aet-devops25/team-code-compass/genai-worker-local:${IMAGE_TAG:-latest}
container_name: flexfit-genai-worker-local
ports:
- "8084:8084"
networks:
- flexfit-network
environment:
- LOCAL_MODEL_TYPE=${LOCAL_MODEL_TYPE:-mock}
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://localhost:11434}
- OLLAMA_MODEL=${OLLAMA_MODEL:-llama2}
- GPT4ALL_MODEL_PATH=${GPT4ALL_MODEL_PATH:-/app/models/ggml-gpt4all-j-v1.3-groovy.bin}
- MOCK_MODE=${MOCK_MODE:-true}
volumes:
- genai_models:/app/models:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8084/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
# Frontend
frontend:
image: ghcr.io/aet-devops25/team-code-compass/frontend:${IMAGE_TAG:-latest}
container_name: flexfit-frontend
ports:
- "3000:3000"
depends_on:
- api-gateway
networks:
- flexfit-network
environment:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8080}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
# Prometheus monitoring
prometheus:
image: prom/prometheus:latest
container_name: flexfit-prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus:/etc/prometheus
- 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'
- '--web.enable-admin-api'
networks:
- flexfit-network
depends_on:
- user-service
- workout-plan-service
- api-gateway
# Grafana dashboards
grafana:
image: grafana/grafana:latest
container_name: flexfit-grafana
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=grafana-piechart-panel
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
networks:
- flexfit-network
depends_on:
- prometheus
# Alertmanager for notifications
alertmanager:
image: prom/alertmanager:latest
container_name: flexfit-alertmanager
ports:
- "9093:9093"
volumes:
- ./monitoring/alertmanager:/etc/alertmanager
- alertmanager_data:/alertmanager
environment:
- SMTP_HOST=${SMTP_HOST:-smtp.gmail.com:587}
- ALERT_EMAIL_FROM=${ALERT_EMAIL_FROM:-hakanduranyt@gmail.com}
- ALERT_EMAIL_TO=${ALERT_EMAIL_TO:-hakanduranyt@gmail.com}
- ALERT_EMAIL_USERNAME=${ALERT_EMAIL_USERNAME:-hakanduranyt@gmail.com}
- ALERT_EMAIL_PASSWORD=${ALERT_EMAIL_PASSWORD:-your_gmail_app_password_here}
entrypoint: ["/etc/alertmanager/start-alertmanager.sh"]
networks:
- flexfit-network
depends_on:
- prometheus
networks:
flexfit-network:
driver: bridge
volumes:
postgres_data:
genai_models:
prometheus_data:
grafana_data:
alertmanager_data: