-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (79 loc) · 2.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
85 lines (79 loc) · 2.48 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
services:
# -------------------------------------------------------------
# Cloud Server Tier (Central Telemetry Collector & Health Check)
# -------------------------------------------------------------
collector-service:
image: ${IMAGE_NAME:-python-grpc}:${IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
command: collector --host 0.0.0.0 --port 50051 --mqtt-host broker.internal --mqtt-port 1883
ports:
- "50051:50051"
depends_on:
- mqtt-broker
environment:
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- MQTT_BROKER_HOST=broker.internal
- MQTT_BROKER_PORT=1883
networks:
cloud-tier:
aliases:
- collector.internal
edge-tier:
restart: unless-stopped
# -------------------------------------------------------------
# External Consumer Tier (Simulates REST Consumer on Host 3)
# -------------------------------------------------------------
rest-gateway:
image: ${IMAGE_NAME:-python-grpc}:${IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
command: gateway --host 0.0.0.0 --port 8000 --grpc-target collector.internal:50051
ports:
- "8000:8000"
depends_on:
- collector-service
environment:
- GRPC_TARGET=collector.internal:50051
networks:
cloud-tier:
restart: unless-stopped
# -------------------------------------------------------------
# MQTT Broker (Industrial Standard IoT Messaging Tier)
# -------------------------------------------------------------
mqtt-broker:
image: eclipse-mosquitto:2.0
command: mosquitto -c /mosquitto-no-auth.conf
ports:
- "1883:1883"
networks:
edge-tier:
aliases:
- broker.internal
cloud-tier:
restart: unless-stopped
# -------------------------------------------------------------
# IoT Microcontroller Sensor Node (Simulates ESP32 + PZEM-004T)
# -------------------------------------------------------------
mqtt-sensor-node:
image: ${IMAGE_NAME:-python-grpc}:${IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
command: sensor-node --broker-host broker.internal --broker-port 1883 --device-id ESP32-PZEM-01 --count 5
depends_on:
- mqtt-broker
environment:
- LOG_LEVEL=${LOG_LEVEL:-INFO}
networks:
edge-tier:
restart: unless-stopped
networks:
cloud-tier:
name: cloud-tier-network
driver: bridge
edge-tier:
name: edge-tier-network
driver: bridge