-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
165 lines (150 loc) · 5.13 KB
/
Copy pathdocker-compose.yml
File metadata and controls
165 lines (150 loc) · 5.13 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
version: '3.8'
# ────────────────────────────────────────────────────────────────
# DataShield Docker Compose
#
# Profiles:
# default — postgres + api only (lightweight dev)
# streaming — adds Kafka, Zookeeper, Schema Registry
# observability — adds Jaeger for distributed tracing
# full — everything
#
# Usage:
# docker compose up # core only
# docker compose --profile streaming up # + Kafka
# docker compose --profile observability up # + Jaeger
# docker compose --profile full up # all
# ────────────────────────────────────────────────────────────────
services:
# ── Core ────────────────────────────────────────────────────
postgres:
image: postgres:15-alpine
container_name: datashield_db
environment:
POSTGRES_USER: datashield
POSTGRES_PASSWORD: datashield_password
POSTGRES_DB: datashield
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U datashield"]
interval: 10s
timeout: 5s
retries: 5
api:
build: .
container_name: datashield_api
environment:
DATABASE_URL: postgresql://datashield:datashield_password@postgres:5432/datashield
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4317
KAFKA_BOOTSTRAP_SERVERS: kafka:9092
DEPLOYMENT_ENVIRONMENT: development
LOG_LEVEL: INFO
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
volumes:
- ./src:/app/src
command: python3 src/api/main.py
# ── Streaming (profile: streaming) ──────────────────────────
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
container_name: datashield_zookeeper
profiles: ["streaming", "full"]
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: datashield_kafka
profiles: ["streaming", "full"]
depends_on:
- zookeeper
ports:
- "9092:9092"
- "9101:9101"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
healthcheck:
test: ["CMD", "kafka-broker-api-versions", "--bootstrap-server", "kafka:29092"]
interval: 30s
timeout: 10s
retries: 5
schema-registry:
image: confluentinc/cp-schema-registry:7.5.0
container_name: datashield_schema_registry
profiles: ["streaming", "full"]
depends_on:
kafka:
condition: service_healthy
ports:
- "8081:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka:29092
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: datashield_kafka_ui
profiles: ["streaming", "full"]
depends_on:
- kafka
- schema-registry
ports:
- "8085:8080"
environment:
KAFKA_CLUSTERS_0_NAME: datashield
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_SCHEMAREGISTRY: http://schema-registry:8081
# ── Observability (profile: observability) ──────────────────
jaeger:
image: jaegertracing/all-in-one:1.52
container_name: datashield_jaeger
profiles: ["observability", "full"]
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "6831:6831/udp"
environment:
COLLECTOR_OTLP_ENABLED: "true"
prometheus:
image: prom/prometheus:v2.48.0
container_name: datashield_prometheus
profiles: ["observability", "full"]
ports:
- "9090:9090"
volumes:
- ./infrastructure/prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.retention.time=7d
grafana:
image: grafana/grafana:10.2.0
container_name: datashield_grafana
profiles: ["observability", "full"]
depends_on:
- prometheus
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: datashield
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana_data:/var/lib/grafana
volumes:
postgres_data:
grafana_data: