-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (89 loc) · 3.36 KB
/
Copy pathdocker-compose.yml
File metadata and controls
94 lines (89 loc) · 3.36 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
# Iris-service-python — local dev stack.
#
# Mirror of the Java side's docker-compose.yml minus the JVM-specific tools
# (Sonar, Maven site). Brings up :
# - postgres — primary DB (Alembic-migrated schema)
# - redis — recent-customers ring buffer (Étape 3)
# - kafka — KRaft mode (no zookeeper), enrichment topics (Étape 4)
# - lgtm — Grafana + Loki + Tempo + Mimir + OTel collector (single
# container — `grafana/otel-lgtm`) for traces / metrics / logs
# via OTLP HTTP on port 4318 (Étape 5)
#
# The Python app itself is NOT in this compose — run it with `bin/run.sh`
# from the host so you get hot-reload + native debugger. Pin everything
# (no floating tags) per the project's "pin every upstream reference" rule.
services:
postgres:
image: postgres:16.6-alpine
container_name: iris-py-postgres
environment:
POSTGRES_DB: iris
POSTGRES_USER: iris
POSTGRES_PASSWORD: iris
ports:
- "5432:5432"
volumes:
- iris-py-pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U iris -d iris"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7.4.1-alpine
container_name: iris-py-redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
kafka:
# KRaft mode (no zookeeper) — bitnami's image bakes in the controller +
# broker on the same node, simplest local setup.
image: bitnami/kafka:3.9.0
container_name: iris-py-kafka
ports:
- "9092:9092"
environment:
# KRaft single-node config
KAFKA_CFG_NODE_ID: "1"
KAFKA_CFG_PROCESS_ROLES: "controller,broker"
KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092,CONTROLLER://:9093"
KAFKA_CFG_ADVERTISED_LISTENERS: "PLAINTEXT://localhost:9092"
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT"
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "1@localhost:9093"
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "PLAINTEXT"
# Auto-create topics for the demo (production should pre-create explicitly)
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: "1"
KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR: "1"
healthcheck:
test: ["CMD-SHELL", "kafka-broker-api-versions.sh --bootstrap-server localhost:9092 || exit 1"]
interval: 10s
timeout: 10s
retries: 10
lgtm:
# All-in-one observability stack from Grafana — Loki + Grafana + Tempo +
# Mimir + a pre-wired OTel Collector receiving on :4318 (HTTP) and :4317 (gRPC).
# Same image as the Java side for parity — dashboards work for both services.
image: grafana/otel-lgtm:0.8.6
container_name: iris-py-lgtm
ports:
- "3000:3000" # Grafana UI
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP — what iris_service.observability.otel uses
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
healthcheck:
test: ["CMD-SHELL", "wget -q -O- http://localhost:3000/api/health || exit 1"]
interval: 10s
timeout: 5s
retries: 12
volumes:
iris-py-pgdata:
name: iris-py-pgdata