-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
184 lines (168 loc) · 4.77 KB
/
docker-compose.yml
File metadata and controls
184 lines (168 loc) · 4.77 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
version: "3.8"
services:
iotdb:
image: apache/iotdb:2.0.5-standalone
container_name: iotflow_iotdb
ports:
- "6667:6667" # IoTDB client port
- "8181:8181" # IoTDB web interface (if enabled)
- "18080:18080" # IoTDB REST API port
environment:
- IOTDB_CONFIG_DIR=/iotdb/conf
volumes:
- iotdb_data:/iotdb/data
- iotdb_logs:/iotdb/logs
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "timeout 5 bash -c '</dev/tcp/localhost/6667' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7-alpine
container_name: iotflow_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# MQTT Broker - Eclipse Mosquitto
mosquitto:
image: eclipse-mosquitto:2.0.22-openssl
container_name: iotflow_mosquitto
ports:
- "1883:1883" # MQTT port
- "9001:9001" # WebSocket port
- "8883:8883" # MQTT SSL port
volumes:
- ./mqtt/config:/mosquitto/config
- ./mqtt/data:/mosquitto/data
- ./mqtt/logs:/mosquitto/log
- mosquitto_data:/mosquitto/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "mosquitto_pub -h localhost -t test -m 'health check' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
# Prometheus service for metrics collection
# prometheus:
# image: prom/prometheus:latest
# container_name: iotflow_prometheus
# extra_hosts:
# - "host.docker.internal:host-gateway"
# ports:
# - "9090:9090"
# volumes:
# - /home/chameau/prometheus:/etc/prometheus
# restart: unless-stopped
# mqtt_exporter:
# image: kpetrem/mqtt-exporter:master
# container_name: iotflow_mqtt_exporter
# environment:
# - MQTT_ADDRESS=192.168.0.1
# - MQTT_TOPIC=\$SYS/#
# ports:
# - "9423:9423"
# restart: unless-stopped
postgres:
image: postgres:15
container_name: iotflow_postgres
environment:
POSTGRES_USER: iotflow
POSTGRES_PASSWORD: iotflowpass
POSTGRES_DB: iotflow
volumes:
- ./instance/postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U iotflow"]
interval: 10s
retries: 5
# Grafana dashboard for visualization
# grafana:
# image: grafana/grafana:latest
# container_name: iotflow_grafana
# ports:
# - "3333:3000"
# extra_hosts:
# - "host.docker.internal:host-gateway"
# volumes:
# - grafana_data:/var/lib/grafana
# - ./grafana/provisioning:/etc/grafana/provisioning
# depends_on:
# - prometheus
# restart: unless-stopped
# Node Exporter for host metrics (CPU, memory, disk)
# node_exporter:
# image: prom/node-exporter:latest
# container_name: iotflow_node_exporter
# volumes:
# - /proc:/host/proc:ro
# - /sys:/host/sys:ro
# - /:/rootfs:ro
# command:
# - "--path.procfs=/host/proc"
# - "--path.sysfs=/host/sys"
# - "--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($|/)"
# extra_hosts:
# - "host.docker.internal:host-gateway"
# ports:
# - "9100:9100"
# restart: unless-stopped
# IoTFlow Connectivity Layer application
# iot_connectivity:
# container_name: iotflow_connectivity
# # If you prefer to use a pre-built image, replace the `build` key with:
# image: ichameau/iotflow-connectivity-layer:gunicorn
# ports:
# - "5000:5000"
# environment:
# - FLASK_ENV=production
# - HOST=0.0.0.0
# - PORT=5000
# - REDIS_URL=redis://redis:6379/0
# - IOTDB_HOST=10.110.190.165
# - IOTDB_PORT=6667
# - IOTDB_USERNAME=root
# - IOTDB_PASSWORD=root
# - MQTT_HOST=mosquitto
# - MQTT_PORT=1883
# - DATABASE_URL=postgresql://iotflow:iotflowpass@postgres:5432/iotflow
# - GUNICORN_WORKERS=1
# # Optional: set admin token for locust/grafana tests
# - IOTFLOW_ADMIN_TOKEN=test
# depends_on:
# redis:
# condition: service_healthy
# mosquitto:
# condition: service_healthy
# # iotdb:
# # condition: service_healthy
# prometheus:
# condition: service_started
# restart: unless-stopped
# healthcheck:
# test: ["CMD-SHELL", "curl -fsS http://localhost:5000/health || exit 1"]
# interval: 30s
# timeout: 5s
# retries: 3
volumes:
iotdb_data:
driver: local
iotdb_logs:
driver: local
redis_data:
driver: local
mosquitto_data:
driver: local
# prometheus_data:
# driver: local
# grafana_data:
# driver: local