-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·37 lines (26 loc) · 1.44 KB
/
setup.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
#!/bin/bash
sudo apt update
sudo apt upgrade
# Install docker, docker-compose
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo -ne '\n' | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable"
sudo apt update
sudo apt install -y docker-ce docker-compose
usermod -aG docker $USER
# install grafana
sudo apt install -y apt-transport-https
sudo apt install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
echo "deb https://packages.grafana.com/enterprise/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt update
sudo apt install -y grafana-enterprise
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl enable grafana-server.service
firewall-cmd --permanent --zone=public --add-rich-rule='rule priority="-31000" family="ipv4" source address="0.0.0.0/0" port port="3000" protocol="tcp" accept'
firewall-cmd --permanent --zone=public --add-rich-rule='rule priority="-31000" family="ipv4" source address="0.0.0.0/0" port port="9090" protocol="tcp" accept'
firewall-cmd --reload
firewall-cmd --complete-reload
docker-compose up -d --build