-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprereqs.sh
executable file
·45 lines (38 loc) · 1.54 KB
/
prereqs.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
#!/bin/bash
# to run
# ssh root@_secret_ip_
# curl -O -L https://raw.githubusercontent.com/token-cjg/hello_drone/master/prereqs.sh
# ./drone.sh
# purge first!
sudo apt-get purge -y nginx nginx-common
# docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
# docker-compose
sudo rm /usr/local/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
# nginx
sudo apt-get install -y nginx
sudo ufw allow 'Nginx Full'
sudo ufw allow ssh
sudo ufw --force enable
sudo ufw status
sudo systemctl status nginx
# nginx, use our defined default file instead
sudo mv /etc/nginx/sites-enabled/default /etc/nginx/sites-available
curl -O -L https://raw.githubusercontent.com/token-cjg/hello_drone/master/fixtures/sites_enabled.alt.default
sudo mv sites_enabled.alt.default /etc/nginx/sites-enabled/default
# nginx, HTTPS /w lets encrypt
# note, need a domain - get one from freenom
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get update -y
sudo apt-get install python-certbot-nginx -y
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d groklemins.tk --keep-until-expiring --no-redirect --register-unsafely-without-email --agree-tos
# sudo certbot renew --dry-run