-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
210 lines (192 loc) · 5.97 KB
/
docker-compose.yml
File metadata and controls
210 lines (192 loc) · 5.97 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
services:
# ==========================================================================
# CORE SERVICES
# ==========================================================================
# Main API Server
api:
build:
context: .
dockerfile: docker/Dockerfile.api
ports:
- "${DOCKER_API_PORT:-8080}:8080"
environment:
- NODE_ENV=${NODE_ENV:-development}
- PORT=8080
- HOST=${HOST:-0.0.0.0}
- API_PREFIX=${API_PREFIX:-/api/v1}
- CORS_ORIGIN=${CORS_ORIGIN:-http://localhost:3000}
- EVENTSTORE_URL=esdb://eventstore:2113?tls=false
- DATABASE_URL=${DATABASE_URL:-postgresql://reclapp:reclapp@postgres:5432/reclapp}
- REDIS_URL=redis://redis:6379
- MQTT_BROKER=mqtt://mqtt:1883
- LOG_LEVEL=${LOG_LEVEL:-info}
- JWT_SECRET=${JWT_SECRET:-dev-secret}
- AI_CONFIDENCE_THRESHOLD=${AI_CONFIDENCE_THRESHOLD:-0.7}
- AI_SANDBOX_MODE=${AI_SANDBOX_MODE:-true}
- CAUSAL_DECAY_RATE=${CAUSAL_DECAY_RATE:-0.01}
volumes:
- ./examples:/app/examples:ro
depends_on:
- eventstore
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 30s
timeout: 10s
retries: 3
# Frontend Dashboard
frontend:
build:
context: .
dockerfile: docker/Dockerfile.frontend
target: production
ports:
- "${DOCKER_FRONTEND_PORT:-3000}:3000"
environment:
- VITE_API_URL=${VITE_API_URL:-http://localhost:8080}
- API_URL=http://api:8080
- WS_URL=ws://api:8080/ws
depends_on:
api:
condition: service_healthy
restart: unless-stopped
# ==========================================================================
# EVENT SOURCING & MESSAGING
# ==========================================================================
# EventStoreDB - Event Sourcing
eventstore:
image: eventstore/eventstore:23.10.0-bookworm-slim
ports:
- "${DOCKER_EVENTSTORE_HTTP_PORT:-2113}:2113" # HTTP/gRPC
- "${DOCKER_EVENTSTORE_TCP_PORT:-1113}:1113" # TCP
environment:
- EVENTSTORE_CLUSTER_SIZE=1
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_START_STANDARD_PROJECTIONS=true
- EVENTSTORE_HTTP_PORT=2113
- EVENTSTORE_INSECURE=${EVENTSTORE_INSECURE:-true}
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
volumes:
- eventstore-data:/var/lib/eventstore
- eventstore-logs:/var/log/eventstore
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:2113/health/live"]
interval: 30s
timeout: 10s
retries: 5
# Redis - Caching & Pub/Sub
redis:
image: redis:7-alpine
ports:
- "${DOCKER_REDIS_PORT:-6379}:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ==========================================================================
# HARDWARE INTEGRATION (Optional)
# ==========================================================================
# MQTT Broker - IoT/Hardware Communication
mqtt:
image: eclipse-mosquitto:2
ports:
- "${DOCKER_MQTT_PORT:-1883}:1883" # MQTT
- "${DOCKER_MQTT_WS_PORT:-9001}:9001" # WebSocket
volumes:
- ./docker/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
- mqtt-data:/mosquitto/data
- mqtt-logs:/mosquitto/log
restart: unless-stopped
profiles:
- hardware
# MQTT Explorer (Development UI)
mqtt-explorer:
image: smeagolworms4/mqtt-explorer
ports:
- "4000:4000"
depends_on:
- mqtt
profiles:
- hardware
- dev
# ==========================================================================
# MONITORING & OBSERVABILITY (Optional)
# ==========================================================================
# Grafana - Dashboards
grafana:
image: grafana/grafana:10-alpine
ports:
- "${DOCKER_GRAFANA_PORT:-3001}:3000"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana-data:/var/lib/grafana
- ./docker/grafana/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
restart: unless-stopped
profiles:
- monitoring
# Prometheus - Metrics
prometheus:
image: prom/prometheus:v2.48.0
ports:
- "${DOCKER_PROMETHEUS_PORT:-9090}:9090"
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
restart: unless-stopped
profiles:
- monitoring
# ==========================================================================
# DEVELOPMENT TOOLS (Optional)
# ==========================================================================
# Adminer - Database UI
adminer:
image: adminer:latest
ports:
- "8081:8080"
restart: unless-stopped
profiles:
- dev
# Swagger UI - API Documentation
swagger:
image: swaggerapi/swagger-ui
ports:
- "8082:8080"
environment:
- SWAGGER_JSON=/api/openapi.yaml
volumes:
- ./docs/openapi.yaml:/api/openapi.yaml:ro
profiles:
- dev
# ==========================================================================
# VOLUMES
# ==========================================================================
volumes:
eventstore-data:
eventstore-logs:
redis-data:
mqtt-data:
mqtt-logs:
grafana-data:
prometheus-data:
# ==========================================================================
# NETWORKS
# ==========================================================================
networks:
default:
name: reclapp-network
driver: bridge