-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
80 lines (53 loc) · 1.59 KB
/
install.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
# -- BUILD AND INSTALL WORLD OF RATIONS --
# Update machine package indexes
sudo apt-get update
# Download and run script to install node 7
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
# Install node 7
sudo apt-get install -y nodejs
# Install 'typescript' node package
npm install -g typescript
# Install 'gulp' node package
npm install -g gulp
# Install 'angular-cli' node package
npm install -g @angular/cli
# Clone 'WorldOfRations' repository
git clone https://github.com/developersworkspace/WorldOfRations.git
# Change directory to 'api'
cd ./WorldOfRations/api
# Install node packages for 'api'
npm install
# Build 'api'
npm run build
# Change directory to 'web'
cd ./../web
# Install node packages for 'web'
npm install
# Build 'web'
npm run build
# Change to root of repository
cd ./../
# Build docker images
docker-compose build --no-cache
# Run docker compose as deamon
docker-compose up -d
# -- INSTALL SSL CERT --
# Update machine package indexes
sudo apt-get update
# Open 443 port
sudo ufw allow 443/tcp
# Install Let's Encrypt cli
sudo apt-get install -y letsencrypt
# Obtain SSL CERT
sudo letsencrypt certonly --agree-tos --standalone --email developersworkspace@gmail.com -d worldofrations.com
# -- INSTALL NGINX --
# Update machine package indexes
sudo apt-get update
# Install NGINX
sudo apt-get install -y nginx
# Add rule to firewall
sudo ufw allow 'Nginx HTTP'
# Download nginx.conf to NGINX directory
curl -o /etc/nginx/nginx.conf https://raw.githubusercontent.com/developersworkspace/WorldOfRations/master/nginx.conf
# Restart NGINX
systemctl restart nginx