-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_launch.sh
54 lines (36 loc) · 1.22 KB
/
server_launch.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
# DGG launch script to configure server
# update
sudo apt-get update
sudo apt-get upgrade
#---- docker ----#
# install docker
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo apt-get install docker-compose
# add user to docker group
sudo usermod -aG docker ubuntu
newgrp docker
#---- github ----#
sudo apt install git
# create GitHub deploy key
cd ~/.ssh
ssh-keygen
#!! Remember to authorize the key on GitHub
# ssh config for github
echo "Host github" >> ~/.ssh/config
echo -e "\tHostName github.com" >> ~/.ssh/config
echo -e "\tUser git" >> ~/.ssh/config
echo -e "\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
# clone repository
mkdir ~/git
cd ~/git
git clone [email protected]:OxfordDemSci/dgg-www
# deploy
cd ~/dgg-www
docker-compose up -d --build