-
Notifications
You must be signed in to change notification settings - Fork 1
/
services.sh
142 lines (119 loc) · 3.19 KB
/
services.sh
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
#!/bin/bash
echo
echo "################################################################"
echo " Cache [sudo] password "
echo "################################################################"
echo
sudo -K
sudo true;
mkdir ~/docker
cd ~/docker
echo
echo "################################################################"
echo " AutoHeal "
echo "################################################################"
echo
mkdir autoheal
cd autoheal
tee ./docker-compose.yml << EOF
version: '3.8'
services:
autoheal:
image: willfarrell/autoheal
container_name: autoheal
environment:
- AUTOHEAL_CONTAINER_LABEL=all
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
EOF
docker-compose up -d
cd ~/docker
echo
echo "################################################################"
echo " Domoticz "
echo "################################################################"
echo
mkdir domoticz
cd domoticz
tee ./docker-compose.yml << EOF
version: '3.8'
services:
domoticz:
image: zoilomora/domoticz:2020.2.13182-beta
container_name: domoticz
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Madrid
volumes:
- ./config:/config
ports:
- 8080:8080
- 6144:6144
- 1443:1443
healthcheck:
test: 'curl -f "http://localhost:8080/json.htm?type=command¶m=getversion" | grep "status" || exit 1'
interval: 30s
timeout: 15s
retries: 2
start_period: 30m
restart: unless-stopped
EOF
docker-compose up -d
cd ~/docker
echo
echo "################################################################"
echo " Node-RED "
echo "################################################################"
echo
## Node-RED
mkdir node-red
cd node-red
tee ./docker-compose.yml << EOF
version: '3.8'
services:
node-red:
container_name: node-red
image: nodered/node-red:1.2.9
environment:
- TZ=Europe/Madrid
ports:
- 1880:1880
volumes:
- ./data:/data
restart: unless-stopped
EOF
mkdir data
docker-compose up -d
cd ~/docker
echo
echo "################################################################"
echo " MQTT "
echo "################################################################"
echo
## MQTT
mkdir mqtt
cd mqtt
tee ./docker-compose.yml << EOF
version: '3.8'
services:
mqtt:
container_name: mqtt
image: eclipse-mosquitto:2.0.10
ports:
- 1883:1883
- 9001:9001
environment:
- PUID=1000
- PGID=1000
volumes:
- ./config:/mosquitto/config
restart: unless-stopped
EOF
mkdir config
docker run --rm -u root:root -v "$(pwd)"/config:/tmp/config eclipse-mosquitto:2.0.10 sh -c "cp /mosquitto/config/mosquitto.conf /tmp/config/mosquitto.conf && chown 1000:1000 /tmp/config/mosquitto.conf"
sudo sed -i "s/#listener/listener 1883/g" ./config/mosquitto.conf
sudo sed -i "s/#allow_anonymous false/allow_anonymous true/g" ./config/mosquitto.conf
docker-compose up -d
cd ~/docker