-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf_file
21 lines (21 loc) · 891 Bytes
/
conf_file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
VAR=`cat /etc/*release | grep -ie "^name" | sed "s/.*=\(.*\)/\1/"`;
sudo apt -y install ssh curl openssh-server apt-transport-https ca-certificates gnupg2 software-properties-common
sudo apt update
if [ $VAR == '"Debian GNU/Linux"' ]; then
echo -e "Debian system\n\n"
OS_NAME='debian'
elif [ $VAR == '"Ubuntu"' ]; then
echo -e "Ubuntu system\n\n"
OS_NAME='ubuntu'
else
echo "Something went wrong"
exit 1
fi
sudo curl -fsSL https://download.docker.com/linux/${OS_NAME}/gpg | sudo apt-key add -
add-apt-repository -y "deb [arch=amd64] http://download.docker.com/linux/${OS_NAME} $(lsb_release -cs) stable"
sudo apt -y update
apt install -y docker-ce
docker volume create psql
docker run -d --restart unless-stopped --name psql -e POSTGRES_PASSWORD=psqlpass -p 5432:5432 -v psql:/var/lib/postgresql/data postgres
echo "Setting up Postgres DB has been done successfully"