-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
219 lines (210 loc) · 6.64 KB
/
docker-compose.prod.yml
File metadata and controls
219 lines (210 loc) · 6.64 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
210
211
212
213
214
215
216
217
218
219
services:
# PostgreSQL Database with persistent storage
postgres:
image: pgvector/pgvector:pg16
container_name: dispatchai-postgres-prod
environment:
POSTGRES_DB: dispatchai
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
expose:
- 5432
volumes:
- postgres_data:/var/lib/postgresql/data
- ./infra/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d dispatchai"]
interval: 10s
timeout: 5s
retries: 5
# Redpanda (Kafka) Message Queue
redpanda:
image: redpandadata/redpanda:latest
container_name: dispatchai-redpanda-prod
command:
- redpanda
- start
- --node-id=0
- --kafka-addr=internal://0.0.0.0:9092,external://0.0.0.0:19092
- --advertise-kafka-addr=internal://redpanda:9092,external://localhost:19092
- --pandaproxy-addr=internal://0.0.0.0:8082,external://0.0.0.0:18082
- --advertise-pandaproxy-addr=internal://redpanda:8082,external://localhost:18082
- --schema-registry-addr=internal://0.0.0.0:8081,external://0.0.0.0:18081
- --rpc-addr=redpanda:33145
- --advertise-rpc-addr=redpanda:33145
- --mode=dev-container
- --smp=1
- --default-log-level=info
ports:
- "18081:18081" # Schema Registry
- "18082:18082" # REST Proxy
- "19092:19092" # Kafka API
volumes:
- redpanda_data:/var/lib/redpanda/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "rpk cluster health"]
interval: 10s
timeout: 5s
retries: 5
# Ingress Service - GitHub webhook receiver
ingress:
build:
context: ./ingress
dockerfile: Dockerfile
container_name: dispatchai-ingress-prod
environment:
PORT: 8000
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
POSTGRES_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
KAFKA_BOOTSTRAP_SERVERS: redpanda:9092
GITHUB_WEBHOOK_SECRET: ${GITHUB_WEBHOOK_SECRET:-}
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# Classifier Service - AI-powered issue analysis
classifier:
build:
context: ./classifier
dockerfile: Dockerfile
container_name: dispatchai-classifier-prod
environment:
PORT: 8001
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
POSTGRES_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
KAFKA_BOOTSTRAP_SERVERS: redpanda:9092
OPENAI_API_KEY: ${OPENAI_API_KEY}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
ports:
- "8001:8001"
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
# Auth Service - GitHub OAuth authentication
auth:
build:
context: ./auth
dockerfile: Dockerfile
container_name: dispatchai-auth-prod
environment:
PORT: 8003
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
POSTGRES_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
GITHUB_REDIRECT_URI: ${GITHUB_REDIRECT_URI:-http://localhost:3000/auth/callback}
JWT_SECRET: ${JWT_SECRET:-dev-jwt-secret-change-in-production}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
CORS_ORIGINS: ${CORS_ORIGINS:-http://5.78.157.202,http://5.78.157.202:3000,http://localhost:3000}
ports:
- "8003:8003"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8003/health"]
interval: 30s
timeout: 10s
retries: 3
# Gateway Service - WebSocket and REST API
gateway:
build:
context: ./gateway
dockerfile: Dockerfile
container_name: dispatchai-gateway-prod
environment:
PORT: 8002
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
POSTGRES_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/dispatchai
KAFKA_BOOTSTRAP_SERVERS: redpanda:9092
CLASSIFIER_SERVICE_URL: http://classifier:8001
AUTH_SERVICE_URL: http://auth:8003
DASHBOARD_URL: ${API_URL:-http://localhost:3000}
CORS_ORIGINS: ${CORS_ORIGINS:-http://5.78.157.202,http://5.78.157.202:3000,http://localhost:3000}
JWT_SECRET: ${JWT_SECRET:-dev-jwt-secret-change-in-production}
ports:
- "8002:8002"
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
classifier:
condition: service_healthy
auth:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002/health"]
interval: 30s
timeout: 10s
retries: 3
# Dashboard - React frontend
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
args:
VITE_API_URL: ${API_URL:-http://localhost:8002}
VITE_WS_URL: ${WS_URL:-ws://localhost:8002/ws}
VITE_AUTH_URL: ${AUTH_URL:-http://localhost:8003}
container_name: dispatchai-dashboard-prod
environment:
PORT: 3000
ports:
- "3000:80"
depends_on:
gateway:
condition: service_healthy
auth:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
# Redpanda Console - Web UI for Kafka management (optional)
redpanda-console:
image: redpandadata/console:latest
container_name: dispatchai-console-prod
environment:
KAFKA_BROKERS: redpanda:9092
KAFKA_SCHEMAREGISTRY_ENABLED: true
KAFKA_SCHEMAREGISTRY_URLS: http://redpanda:8081
ports:
- "8080:8080"
depends_on:
redpanda:
condition: service_healthy
restart: unless-stopped
profiles:
- tools
volumes:
postgres_data:
driver: local
redpanda_data:
driver: local
networks:
default:
name: dispatchai-prod