-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
151 lines (141 loc) · 5.35 KB
/
Copy pathdocker-compose.yml
File metadata and controls
151 lines (141 loc) · 5.35 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
services:
# ── PostgreSQL ──────────────────────────────────────────────────────────────
postgres:
image: postgres:15
environment:
POSTGRES_DB: queryforge
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./coordinator/schema.sql:/docker-entrypoint-initdb.d/schema.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d queryforge"]
interval: 5s
timeout: 5s
retries: 10
# ── MinIO ───────────────────────────────────────────────────────────────────
minio:
image: minio/minio
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 10
# ── Coordinator ─────────────────────────────────────────────────────────────
coordinator:
build:
context: .
dockerfile: coordinator/Dockerfile
ports:
- "3000:3000" # REST API + WebSocket
- "50050:50050" # gRPC CoordinatorService (workers call in)
environment:
DATABASE_URL: postgresql://postgres:password@postgres:5432/queryforge
MINIO_ENDPOINT: minio
MINIO_PORT: "9000"
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
WORKER_ADDRESSES: worker-1:50051,worker-2:50051,worker-3:50051
OTEL_SERVICE_NAME: coordinator
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
restart: on-failure
# ── Worker 1 ────────────────────────────────────────────────────────────────
worker-1:
build:
context: .
dockerfile: worker/Dockerfile
environment:
WORKER_ID: worker-1
WORKER_PORT: "50051"
COORDINATOR_ADDRESS: coordinator:50050
MINIO_ENDPOINT: minio
MINIO_PORT: "9000"
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
OTEL_SERVICE_NAME: worker-1
depends_on:
- coordinator
restart: on-failure
# ── Worker 2 ────────────────────────────────────────────────────────────────
worker-2:
build:
context: .
dockerfile: worker/Dockerfile
environment:
WORKER_ID: worker-2
WORKER_PORT: "50051"
COORDINATOR_ADDRESS: coordinator:50050
MINIO_ENDPOINT: minio
MINIO_PORT: "9000"
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
OTEL_SERVICE_NAME: worker-2
depends_on:
- coordinator
restart: on-failure
# ── Worker 3 ────────────────────────────────────────────────────────────────
worker-3:
build:
context: .
dockerfile: worker/Dockerfile
environment:
WORKER_ID: worker-3
WORKER_PORT: "50051"
COORDINATOR_ADDRESS: coordinator:50050
MINIO_ENDPOINT: minio
MINIO_PORT: "9000"
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
OTEL_SERVICE_NAME: worker-3
depends_on:
- coordinator
restart: on-failure
# ── Frontend ─────────────────────────────────────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "5173:5173"
environment:
VITE_COORDINATOR_URL: http://localhost:3000
VITE_WS_URL: ws://localhost:3000
depends_on:
- coordinator
# ── Prometheus ───────────────────────────────────────────────────────────────
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
# ── Grafana ──────────────────────────────────────────────────────────────────
grafana:
image: grafana/grafana
ports:
- "3001:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
GF_PATHS_PROVISIONING: /etc/grafana/provisioning
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/provisioning:/etc/grafana/provisioning
- ./monitoring/dashboards:/etc/grafana/provisioning/dashboards
volumes:
postgres_data:
minio_data:
grafana_data: