-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (106 loc) · 3.18 KB
/
docker-compose.yml
File metadata and controls
114 lines (106 loc) · 3.18 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
version: "3.9"
services:
# ── TimescaleDB (serie temporali) ──────────────────────
timescaledb:
image: timescale/timescaledb:latest-pg16
container_name: sentinel_timescale
environment:
POSTGRES_USER: sentinel
POSTGRES_PASSWORD: password
POSTGRES_DB: sentinel_db
ports:
- "5432:5432"
volumes:
- timescale_data:/var/lib/postgresql/data
- ./scripts/init_db.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sentinel"]
interval: 10s
timeout: 5s
retries: 5
# ── Qdrant (vector search) ─────────────────────────────
qdrant:
image: qdrant/qdrant:latest
container_name: sentinel_qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:6333/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
# ── Redis (cache + pub/sub) ────────────────────────────
redis:
image: redis:7-alpine
container_name: sentinel_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ── Kafka + Zookeeper (stream processing) ─────────────
zookeeper:
image: confluentinc/cp-zookeeper:7.6.1
container_name: sentinel_zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
volumes:
- zookeeper_data:/var/lib/zookeeper/data
kafka:
image: confluentinc/cp-kafka:7.6.1
container_name: sentinel_kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
volumes:
- kafka_data:/var/lib/kafka/data
healthcheck:
test: ["CMD", "kafka-topics", "--list", "--bootstrap-server", "localhost:9092"]
interval: 30s
timeout: 10s
retries: 5
# ── SENTINEL API ───────────────────────────────────────
sentinel_api:
build: .
container_name: sentinel_api
depends_on:
timescaledb:
condition: service_healthy
qdrant:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "8000:8000"
env_file:
- .env
environment:
TIMESCALE_URL: postgresql+asyncpg://sentinel:password@timescaledb:5432/sentinel_db
QDRANT_HOST: qdrant
REDIS_URL: redis://redis:6379/0
KAFKA_BOOTSTRAP_SERVERS: kafka:9092
volumes:
- .:/app
command: uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload
volumes:
timescale_data:
qdrant_data:
redis_data:
zookeeper_data:
kafka_data: