Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
206 lines (193 loc) · 5.96 KB
/
Copy pathdocker-compose.yml
File metadata and controls
206 lines (193 loc) · 5.96 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: timescale/timescaledb:latest-pg16
container_name: freedomtalk-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: freedomtalk
command: postgres -c shared_preload_libraries=timescaledb
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
# Redis Cache
redis:
image: redis:7-alpine
container_name: freedomtalk-redis
restart: unless-stopped
ports:
- '6379:6379'
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
# RabbitMQ Message Broker
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: freedomtalk-rabbitmq
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: rabbitmq
RABBITMQ_DEFAULT_PASS: rabbitmq
ports:
- '5672:5672' # AMQP port
- '15672:15672' # Management UI
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ['CMD', 'rabbitmq-diagnostics', 'ping']
interval: 10s
timeout: 5s
retries: 5
# MinIO Object Storage (S3-compatible)
minio:
image: minio/minio:latest
container_name: freedomtalk-minio
restart: unless-stopped
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- '9000:9000' # API port
- '9001:9001' # Console port
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 10s
timeout: 5s
retries: 5
# Meilisearch (Full-text search engine)
meilisearch:
image: getmeili/meilisearch:v1.10
container_name: freedomtalk-meilisearch
restart: unless-stopped
environment:
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-masterKey}
MEILI_ENV: development
ports:
- '7700:7700'
volumes:
- meilisearch_data:/data
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:7700/health']
interval: 10s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# Observability stack (traces + metrics + dashboards)
# ---------------------------------------------------------------------------
# NOTE: the API itself is not part of this infra-only compose file. To point
# a locally running API (packages/api) at this stack, use these env defaults:
# OTEL_ENABLED=true
# OTEL_SERVICE_NAME=freedomtalk-api
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 (otel-collector, traces)
# PORT=3000 (matches deploy/prometheus.yml)
# MEILISEARCH_HOST=http://localhost:7700
# RABBITMQ_URL=amqp://rabbitmq:rabbitmq@localhost:5672
#
# Jaeger UI: http://localhost:16686
# Prometheus: http://localhost:9090
# Grafana: http://localhost:3001 (admin/admin)
# OpenTelemetry Collector - receives OTLP traces from the API and forwards
# to Jaeger; publishes OTLP 4317/4318 on the host
otel-collector:
image: otel/opentelemetry-collector-contrib:0.162.0
container_name: freedomtalk-otel-collector
restart: unless-stopped
command: ['--config=/etc/otelcol/config.yaml']
ports:
- '4317:4317' # OTLP gRPC
- '4318:4318' # OTLP HTTP
volumes:
- ./deploy/otel-collector-config.yaml:/etc/otelcol/config.yaml:ro
depends_on:
- jaeger
# Jaeger all-in-one - trace storage + UI. Accepts OTLP from the collector
# on 4317/4318 inside the compose network (ports intentionally NOT published
# on the host; the collector owns those host ports)
jaeger:
image: jaegertracing/all-in-one:1.76.0
container_name: freedomtalk-jaeger
restart: unless-stopped
environment:
COLLECTOR_OTLP_ENABLED: 'true'
ports:
- '16686:16686' # Jaeger UI
expose:
- '4317' # OTLP gRPC (from collector)
- '4318' # OTLP HTTP (from collector)
# Prometheus - scrapes the API /metrics and the RabbitMQ prometheus plugin
prometheus:
image: prom/prometheus:v3.13.4
container_name: freedomtalk-prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.retention.time=7d'
ports:
- '9090:9090'
volumes:
- ./deploy/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
extra_hosts:
- 'host-gateway:host-gateway' # resolves host.docker.internal on Linux
healthcheck:
test: ['CMD', 'promtool', 'query', 'instant', 'http://localhost:9090', 'up']
interval: 30s
timeout: 5s
retries: 5
# Grafana - dashboards, auto-provisioned with the Prometheus datasource and
# the FreedomTalk API dashboard from deploy/
grafana:
image: grafana/grafana:13.2.3
container_name: freedomtalk-grafana
restart: unless-stopped
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
ports:
- '3001:3000'
volumes:
- ./deploy/grafana-provisioning:/etc/grafana/provisioning:ro
- ./deploy/grafana-dashboard.json:/var/lib/grafana/dashboards/freedomtalk-api.json:ro
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/health']
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
driver: local
redis_data:
driver: local
rabbitmq_data:
driver: local
minio_data:
driver: local
meilisearch_data:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
networks:
default:
name: freedomtalk-network