forked from FarnazAliakbari3/Lab_temp_hum_monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
146 lines (136 loc) · 3.84 KB
/
docker-compose.yml
File metadata and controls
146 lines (136 loc) · 3.84 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
services:
mqtt:
image: eclipse-mosquitto:2
container_name: temp_hum_mqtt
restart: unless-stopped
ports:
- "1883:1883"
- "9001:9001"
healthcheck:
test: ["CMD-SHELL", "mosquitto_sub -h localhost -p 1883 -t '$$SYS/broker/uptime' -C 1 -W 15 >/dev/null 2>&1 || exit 1"]
interval: 20s
timeout: 5s
retries: 3
start_period: 5s
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
controller:
build:
context: .
dockerfile: Dockerfile
image: temp_hum_app
container_name: temp_hum_controller
restart: unless-stopped
command: ["python", "-u", "-m", "controller.controller_api"]
environment:
- MQTT_HOST=mqtt
- MQTT_PORT=1883
- CONTROL_LOOP_SEC=5
- MOCK_SENSORS=1
- SIM_LOOP_SEC=10
- LOG_DIR=/tmp/logs
depends_on:
mqtt:
condition: service_healthy
ports:
- "8081:8081"
volumes:
- ./catalog:/app/catalog
- ./controller:/app/controller
- ./Device_connectors:/app/Device_connectors
- ./simulators:/app/simulators
- logsdata:/tmp/logs
registry:
image: temp_hum_app
container_name: temp_hum_registry
restart: unless-stopped
command: ["python", "-u", "-m", "catalog_registry.registry_api"]
environment:
- MQTT_HOST=mqtt
- MQTT_PORT=1883
- REGISTRY_ENABLE_CONTROLLER=0
- CONTROLLER_URL=http://controller:8081
- LOG_DIR=/tmp/logs
depends_on:
controller:
condition: service_started
ports:
- "8080:8080"
volumes:
- ./catalog:/app/catalog
- ./catalog_registry:/app/catalog_registry
- logsdata:/tmp/logs
thingspeak:
image: temp_hum_app
container_name: temp_hum_thingspeak
restart: unless-stopped
command: ["python", "-u", "-m", "ThingSpeak.adaptor"]
environment:
- REGISTRY_API_URL=http://registry:8080
- THINGSPEAK_API_KEY=${THINGSPEAK_API_KEY:-}
- THINGSPEAK_LAB_ID=${THINGSPEAK_LAB_ID:-}
- THINGSPEAK_POLL_SEC=${THINGSPEAK_POLL_SEC:-60}
depends_on:
registry:
condition: service_started
volumes:
- ./ThingSpeak:/app/ThingSpeak
- ./catalog:/app/catalog
telegram_bot:
image: temp_hum_app
container_name: temp_hum_telegram
restart: unless-stopped
command: ["python", "-u", "-m", "User_awareness.telegram_bot"]
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- REGISTRY_API_URL=http://registry:8080
depends_on:
registry:
condition: service_started
volumes:
- ./User_awareness:/app/User_awareness
- ./catalog_registry:/app/catalog_registry
- ./catalog:/app/catalog
frontend:
image: nginx:alpine
container_name: temp_hum_frontend
restart: unless-stopped
depends_on:
registry:
condition: service_started
ports:
- "80:80"
volumes:
- ./frontEnd:/usr/share/nginx/html:ro
sensor_logs:
image: busybox:1.36
container_name: temp_hum_sensor_logs
restart: unless-stopped
command: sh -c "touch /tmp/logs/sensors.log && tail -n+1 -f /tmp/logs/sensors.log"
depends_on:
controller:
condition: service_started
volumes:
- logsdata:/tmp/logs
actuator_logs:
image: busybox:1.36
container_name: temp_hum_actuator_logs
restart: unless-stopped
command: ["sh", "-c", "touch /tmp/logs/actuators.log && tail -n+1 -f /tmp/logs/actuators.log"]
depends_on:
controller:
condition: service_started
volumes:
- logsdata:/tmp/logs
logic_logs:
image: busybox:1.36
container_name: temp_hum_logic_logs
restart: unless-stopped
command: ["sh", "-c", "touch /tmp/logs/logic.log && tail -n+1 -f /tmp/logs/logic.log"]
depends_on:
controller:
condition: service_started
volumes:
- logsdata:/tmp/logs
volumes:
logsdata: