File tree 5 files changed +34
-27
lines changed
5 files changed +34
-27
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ services:
22
22
- ' default.docker-env'
23
23
24
24
# Consider adding mosquitto broker
25
- # mqtt:
26
- # ports:
27
- # - 1884:1883
28
- # env_file:
29
- # - 'default.docker-env'
25
+ mqtt :
26
+ ports :
27
+ - 1884:1883
28
+ env_file :
29
+ - ' default.docker-env'
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ services:
20
20
# MYSQL Database
21
21
db :
22
22
# Official MYSQL docker image
23
- image : mariadb:latest
23
+ image : mariadb:11.0
24
24
environment :
25
25
- " MYSQL_HOST=localhost"
26
26
- " MARIADB_AUTO_UPGRADE=1"
@@ -34,22 +34,22 @@ services:
34
34
35
35
redis :
36
36
# Official redis image
37
- image : redis:latest
37
+ image : redis:7.0
38
38
volumes :
39
39
- emon-redis-data:/data
40
40
logging :
41
41
driver : json-file
42
42
options :
43
43
max-size : " 10m"
44
-
45
- # Consider including mosquitto broker service
46
- # Needs to be running elsewhere otherwise
47
- # but maybe thats best..
48
-
49
- # mqtt :
50
- # image: eclipse-mosquitto:latest
51
- # build: mqtt/.
52
- # restart: always
44
+
45
+ mqtt :
46
+ image : eclipse-mosquitto:2.0
47
+ build : mqtt/.
48
+ restart : always
49
+ logging :
50
+ driver : json-file
51
+ options :
52
+ max-size : " 10m "
53
53
54
54
volumes :
55
55
emon-phpfiwa :
Original file line number Diff line number Diff line change 1
- FROM eclipse-mosquitto:latest
2
-
1
+ FROM eclipse-mosquitto:2.0
2
+ COPY mosquitto.conf /mosquitto/config/mosquitto.conf
3
3
COPY setup.sh /
4
4
RUN chmod +x /setup.sh
5
5
RUN /setup.sh
Original file line number Diff line number Diff line change
1
+ persistence false
2
+ allow_anonymous false
3
+ password_file /mosquitto/config/passwd
4
+
5
+
6
+ log_timestamp true
7
+ log_timestamp_format %Y-%m-%dT%H:%M:%S
8
+ log_type error
9
+ log_type warning
10
+ log_type notice
11
+ log_type information
12
+ log_dest file /mosquitto/log/mosquitto.log
13
+ log_dest stdout
14
+
15
+ listener 1883
16
+
Original file line number Diff line number Diff line change 1
- # Disable mosquitto persistance
2
- sed -i " s/^persistence true/persistence false/" /mosquitto/config/mosquitto.conf
3
- # append line: allow_anonymous false
4
- sed -i -n ' /allow_anonymous false/!p;$a allow_anonymous false' /mosquitto/config/mosquitto.conf
5
- # append line: password_file /etc/mosquitto/passwd
6
- sed -i -n ' /password_file \/mosquitto\/config\/passwd/!p;$a password_file \/mosquitto\/config\/passwd' /mosquitto/config/mosquitto.conf
7
- # append line: log_type error
8
- sed -i -n ' /log_type error/!p;$a log_type error' /mosquitto/config/mosquitto.conf
9
-
10
1
# Create mosquitto password file
11
2
touch /mosquitto/config/passwd
12
3
mosquitto_passwd -b /mosquitto/config/passwd emonpi emonpimqtt2016
You can’t perform that action at this time.
0 commit comments