-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
209 lines (200 loc) · 8.63 KB
/
docker-compose.yml
File metadata and controls
209 lines (200 loc) · 8.63 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
206
207
208
209
services:
# ══════════════════════════════════════════════════════════════════════════
# Redis Cache (LRU eviction for search result caching)
# ══════════════════════════════════════════════════════════════════════════
redis:
image: redis:7-alpine
container_name: vectorscale-redis
ports:
- "6379:6379"
command: >
redis-server
--maxmemory 512mb
--maxmemory-policy allkeys-lru
--appendonly no
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
networks:
- vectorscale-net
# ══════════════════════════════════════════════════════════════════════════
# MinIO (S3-compatible object storage for Delta Lake and indexes)
# ══════════════════════════════════════════════════════════════════════════
minio:
image: minio/minio:latest
container_name: vectorscale-minio
ports:
- "9000:9000" # S3 API
- "9001:9001" # Web Console
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 3
networks:
- vectorscale-net
# ── MinIO bucket initialization ───────────────────────────────────────────
minio-init:
image: minio/mc:latest
container_name: vectorscale-minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://minio:9000 minioadmin minioadmin;
mc mb myminio/delta-lake --ignore-existing;
mc mb myminio/indexes --ignore-existing;
mc mb myminio/raw-data --ignore-existing;
echo 'MinIO buckets initialized successfully';
"
networks:
- vectorscale-net
# ══════════════════════════════════════════════════════════════════════════
# Python gRPC Sidecar (Embedding + FAISS Index Service)
# ══════════════════════════════════════════════════════════════════════════
sidecar:
build:
context: ./sidecar
dockerfile: Dockerfile
container_name: vectorscale-sidecar
ports:
- "50051:50051"
environment:
GRPC_PORT: 50051
INDEX_DIR: /data/indexes
EMBEDDING_MODEL: all-MiniLM-L6-v2
MAX_WORKERS: 10
volumes:
- ./data/indexes:/data/indexes:ro # Read-only mount for FAISS indexes
healthcheck:
test: ["CMD", "python3", "-c", "import socket; s=socket.socket(); s.settimeout(3); s.connect(('localhost', 50051)); s.close()"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
networks:
- vectorscale-net
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '1.0'
memory: 2G
# ══════════════════════════════════════════════════════════════════════════
# .NET 8 Web API (RESTful search endpoint + observability)
# ══════════════════════════════════════════════════════════════════════════
api:
build:
context: .
dockerfile: src/VectorScale.Api/Dockerfile
container_name: vectorscale-api
ports:
- "8080:8080" # HTTP API + Prometheus /metrics
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:8080
VectorScale__SidecarGrpcAddress: http://sidecar:50051
VectorScale__Redis__ConnectionString: redis:6379
VectorScale__Redis__KeyPrefix: "vc:"
VectorScale__Redis__DefaultCacheTtlSeconds: 300
VectorScale__Faiss__DefaultTopK: 10
VectorScale__Faiss__DefaultNprobe: 10
VectorScale__Faiss__DefaultShardKey: nyc_taxi_2023
VectorScale__Storage__MinioEndpoint: http://minio:9000
VectorScale__Storage__MinioAccessKey: minioadmin
VectorScale__Storage__MinioSecretKey: minioadmin
VectorScale__RateLimit__PermitLimit: 100
VectorScale__RateLimit__WindowSeconds: 10
depends_on:
redis:
condition: service_healthy
sidecar:
condition: service_healthy
minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health/live"]
interval: 15s
timeout: 3s
retries: 3
start_period: 10s
networks:
- vectorscale-net
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
# ══════════════════════════════════════════════════════════════════════════
# Jaeger (Distributed tracing for OpenTelemetry)
# ══════════════════════════════════════════════════════════════════════════
jaeger:
image: jaegertracing/all-in-one:1.52
container_name: vectorscale-jaeger
ports:
- "6831:6831/udp" # Jaeger compact thrift (legacy)
- "16686:16686" # Jaeger UI
- "14268:14268" # Jaeger HTTP collector
environment:
COLLECTOR_OTLP_ENABLED: true
networks:
- vectorscale-net
# ══════════════════════════════════════════════════════════════════════════
# Prometheus (Metrics aggregation and alerting)
# ══════════════════════════════════════════════════════════════════════════
prometheus:
image: prom/prometheus:v2.48.1
container_name: vectorscale-prometheus
ports:
- "9090:9090"
volumes:
- ./infra/docker/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- 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'
networks:
- vectorscale-net
# ══════════════════════════════════════════════════════════════════════════
# Grafana (Metrics visualization)
# ══════════════════════════════════════════════════════════════════════════
grafana:
image: grafana/grafana:10.2.3
container_name: vectorscale-grafana
ports:
- "3000:3000"
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- ./infra/grafana/provisioning:/etc/grafana/provisioning
- ./infra/grafana/dashboards:/var/lib/grafana/dashboards
- grafana-data:/var/lib/grafana
networks:
- vectorscale-net
depends_on:
- prometheus
networks:
vectorscale-net:
driver: bridge
volumes:
minio-data:
prometheus-data:
grafana-data: