-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
186 lines (173 loc) · 4.39 KB
/
docker-compose.yaml
File metadata and controls
186 lines (173 loc) · 4.39 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
services:
db:
image: postgres:15
restart: always
environment:
POSTGRES_USER: robogo
POSTGRES_PASSWORD: robogo_pass
POSTGRES_DB: robogo_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
server:
build:
dockerfile: server/Dockerfile
environment:
- SPRING_PROFILES_ACTIVE=prod
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/robogo_db
- SPRING_DATASOURCE_USERNAME=robogo
- SPRING_DATASOURCE_PASSWORD=robogo_pass
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=admin
- REDIS_HOST=redis
- REDIS_PORT=6379
ports:
- "8081:8081"
depends_on:
- db
- redis
labels:
- "logging.jobname=server"
gateway:
build:
dockerfile: api-gateway/Dockerfile
environment:
- SPRING_PROFILES_ACTIVE=prod
- SERVER_SERVICE_SERVICE_HOST=server
- SERVER_SERVICE_SERVICE_PORT=8081
- GENAI_SERVICE_SERVICE_HOST=genai
- GENAI_SERVICE_SERVICE_PORT=5000
ports:
- "8080:8080"
depends_on:
- server
labels:
- "logging.jobname=gateway"
client:
build:
context: ./client
dockerfile: Dockerfile
environment:
- GATEWAY_HOST=gateway
ports:
- "3001:3000"
labels:
- "logging.jobname=client"
genai:
build:
context: ./genai
dockerfile: Dockerfile
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_DB=0
- REDIS_TTL=3600
ports:
- "5000:5000"
depends_on:
- redis
labels:
- "logging.jobname=genai"
redis:
image: redis:7-alpine
restart: always
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
labels:
- "logging.jobname=redis"
redis-exporter:
image: oliver006/redis_exporter:v1.61.0
restart: always
environment:
- REDIS_ADDR=redis:6379
ports:
- "9121:9121"
depends_on:
- redis
labels:
- "logging.jobname=redis-exporter"
prometheus:
image: prom/prometheus:v2.45.0
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- ./monitoring/alert.rules.yml:/etc/prometheus-rules/alert.rules.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
depends_on:
- postgres-exporter
- redis-exporter
postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter
restart: always
environment:
- DATA_SOURCE_NAME=postgresql://robogo:robogo_pass@db:5432/robogo_db?sslmode=disable
ports:
- "9187:9187"
depends_on:
- db
loki:
image: grafana/loki:2.9.2
ports:
- "3100:3100"
volumes:
- ./monitoring/loki-config.yml:/etc/loki/local-config.yml
promtail:
image: grafana/promtail:2.9.2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./monitoring/promtail-config.yml:/etc/promtail/config.yml
command: -config.file=/etc/promtail/config.yml
grafana:
image: grafana/grafana:10.1.5
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/provisioning/:/etc/grafana/provisioning/
environment:
- GF_LOG_LEVEL=debug
- GF_SECURITY_ADMIN_USER=admin # TODO: change to a random string in production
- GF_SECURITY_ADMIN_PASSWORD=admin # TODO: change to a random string in production
- GF_USERS_ALLOW_SIGN_UP=false
depends_on:
- prometheus
- db
- postgres-exporter
- loki
- promtail
- genai
- server
- gateway
- client
alertmanager:
image: prom/alertmanager:v0.26.0
ports:
- "9093:9093"
volumes:
- ./monitoring/alertmanager.yml:/etc/alertmanager/alertmanager.yml
- alertmanager_data:/alertmanager
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
- '--web.listen-address=:9093'
depends_on:
- prometheus
labels:
- "logging.jobname=alertmanager"
volumes:
postgres_data:
prometheus_data:
grafana_data:
redis_data:
alertmanager_data: