-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
269 lines (252 loc) · 6.64 KB
/
docker-compose.yml
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
version: '3.3'
services:
api:
container_name: api
build: ./python-api
restart: unless-stopped
expose:
- "5000"
volumes:
- ./python-api/logs:/app/logs
env_file:
- 'variables.env'
secrets:
- api_secrets
depends_on:
- mongodb
environment:
- MONGODB_HOST=mongodb
- INFLUXDB_HOST=influxdb
- VIRTUAL_HOST=api.iotcloud.es
- VIRTUAL_PORT=5000
- LETSENCRYPT_HOST=api.iotcloud.es
influx_mqtt_gateway:
container_name: gateway
build: ./python-gateway
env_file:
- 'variables.env'
restart: unless-stopped
volumes:
- ./python-gateway/logs:/app/logs
secrets:
- gateway_secrets
depends_on:
- influxdb
weather:
container_name: weather
build: ./python-weather
env_file:
- 'variables.env'
restart: unless-stopped
expose:
- "5003"
volumes:
- ./python-weather/logs:/app/logs
secrets:
- weather_secrets
modules2:
container_name: modules2
build: ./python-modules2
env_file:
- 'variables.env'
restart: unless-stopped
volumes:
- ./python-modules2/logs:/app/logs
secrets:
- modules_secrets
monitoring:
container_name: monitoring
build: ./python-monitoring
restart: unless-stopped
volumes:
- ./python-monitoring/logs:/app/logs
- /run/user/1000/docker.sock:/var/run/docker.sock:ro # rootless mode
# - /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/hostname:/app/hostname:ro
env_file:
- 'variables.env'
energy:
container_name: energy
build: ./python-energy
restart: unless-stopped
volumes:
- ./python-energy/logs:/app/logs
- ./python-energy/source:/app/source
env_file:
- 'variables.env'
secrets:
- energy_secrets
home:
container_name: home
build: ./go-home
env_file:
- 'variables.env'
restart: unless-stopped
expose:
- "5001"
volumes:
- ./go-home/src:/app/src
- ./go-home/logs:/app/logs
secrets:
- home_secrets
environment:
- VIRTUAL_HOST=home.iotcloud.es
- VIRTUAL_PORT=5001
- LETSENCRYPT_HOST=home.iotcloud.es
grafana-datasource:
container_name: grafana-datasource
build: ./go-grafana-datasource
env_file:
- 'variables.env'
restart: unless-stopped
expose:
- "5002"
volumes:
- ./go-grafana-datasource/src:/app/src
- ./go-grafana-datasource/logs:/app/logs
secrets:
- grafana_datasource_secrets
grafana:
restart: unless-stopped
image: grafana/grafana:latest
user: '0'
expose:
- "3000"
volumes:
- ./grafana/data:/var/lib/grafana
- ./grafana/config:/etc/grafana
- ./grafana/log:/var/log/grafana
environment:
- GF_INSTALL_PLUGINS=simpod-json-datasource 0.2.6
- GF_AUTH_GENERIC_OAUTH_CLIENT_ID__FILE=/run/secrets/grafana_secrets_clientId
- GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET__FILE=/run/secrets/grafana_secrets_clientSecret
- VIRTUAL_HOST=grafana.iotcloud.es
- VIRTUAL_PORT=3000
- LETSENCRYPT_HOST=grafana.iotcloud.es
secrets:
- grafana_secrets_clientId
- grafana_secrets_clientSecret
mongodb:
restart: unless-stopped
image: mongo:6.0
hostname: docker
volumes:
- mongodb_data:/data/db
expose:
- "27017"
command: mongod --setParameter diagnosticDataCollectionEnabled=false # --quiet
influxdb:
image: influxdb:1.8
env_file:
- 'variables.env'
volumes:
# Mount for influxdb data directory
- influxdb_data:/var/lib/influxdb
# Mount for influxdb configuration
- ./influxdb/config/:/etc/influxdb/
expose:
- "8086"
- "8088"
restart: unless-stopped
mosquitto:
image: iegomez/mosquitto-go-auth
restart: unless-stopped
volumes:
- ./mosquitto/data:/var/lib/mosquitto
- ./mosquitto/log:/var/log/mosquitto
- ./mosquitto/config:/etc/mosquitto
ports:
- "8883:8883"
- "1883:1883"
expose:
- "9001"
environment:
- VIRTUAL_HOST=mqtt.iotcloud.es
- VIRTUAL_PORT=9001
- LETSENCRYPT_HOST=mqtt.iotcloud.es
telegraf:
image: telegraf
restart: unless-stopped
env_file:
- 'variables.env'
hostname: localhost
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- proxy_nginx_logs:/var/log/nginx:ro
- ./python-modules2/logs/modules.log:/var/log/modules/modules.log:ro
- ./python-api/logs/server.log:/var/log/api/server.log:ro
- ./python-monitoring/logs/monitoring.log:/var/log/monitoring/monitoring.log:ro
- ./python-weather/logs/weather.log:/var/log/weather/weather.log:ro
- ./mosquitto/log/mosquitto.log:/var/log/mosquitto/mosquitto.log:ro
- ./go-home/logs/main.log:/var/log/home/main.log:ro
depends_on:
- influxdb
ota:
image: flashspys/nginx-static
restart: unless-stopped
container_name: ota
expose:
- "5004"
volumes:
- ./ota/data:/static
- ./ota/config/default.conf:/etc/nginx/conf.d/default.conf
environment:
- VIRTUAL_HOST=ota.iotcloud.es
- VIRTUAL_PORT=5004
- LETSENCRYPT_HOST=ota.iotcloud.es
backup-manager:
build: ./backup-manager
restart: unless-stopped
container_name: backup-manager
env_file:
- 'variables.env'
volumes:
- ./backups:/backups
- ./grafana/data/grafana.db:/grafana.db:ro
- gdrive_config:/gdrive/config
secrets:
- gdrive_config
- gdrive_backup_folder
dynhost-updater:
build: ./ovh-dynhost-updater
restart: unless-stopped
volumes:
- ./ovh-dynhost-updater/logs/records.log:/dynhost/records.log
environment:
HOSTNAME: "secrets_file"
IDENTIFIER: "secrets_file"
PASSWORD: "secrets_file"
LOG_LEVEL: "info"
secrets:
- dynhost
volumes:
gdrive_config:
mongodb_data:
influxdb_data:
proxy_nginx_logs:
external: true
secrets:
modules_secrets:
file: ./python-modules2/secrets
weather_secrets:
file: ./python-weather/secrets
home_secrets:
file: ./go-home/secrets
grafana_datasource_secrets:
file: ./go-grafana-datasource/secrets
api_secrets:
file: ./python-api/secrets
gateway_secrets:
file: ./python-gateway/secrets
grafana_secrets_clientId:
file: ./grafana/secrets/clientId
grafana_secrets_clientSecret:
file: ./grafana/secrets/clientSecret
gdrive_config:
file: ./backup-manager/secrets/gdrive_config
gdrive_backup_folder:
file: ./backup-manager/secrets/gdrive_backup_folder
dynhost:
file: ./ovh-dynhost-updater/secrets
energy_secrets:
file: ./python-energy/secrets