-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverbuild.bash
More file actions
42 lines (41 loc) · 1.31 KB
/
serverbuild.bash
File metadata and controls
42 lines (41 loc) · 1.31 KB
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
sudo apt update && sudo apt upgrade -y
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
sed -i 's/\[ -z "$PS1" \] && return/#&/' ~/.bashrc
source ~/.bashrc
nvm install 20
npm install -g pnpm
pnpm setup
source ~/.bashrc
pnpm install -g pm2
sudo apt install nginx -y
sudo tee /etc/nginx/sites-available/ripplesftc.com > /dev/null <<EOF
server {
listen 80;
server_name ripplesftc.com www.ripplesftc.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host \$host;
proxy_cache_bypass \$http_upgrade;
}
}
EOF
sudo ln -s /etc/nginx/sites-available/ripplesftc.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
sudo ufw allow 'Nginx Full' # Allows both HTTP and HTTPS traffic
sudo ufw allow OpenSSH
sudo ufw enable
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d ripplesftc.com -d www.ripplesftc.com
sudo mkdir -p /var/www/ripplesftc.com
cd /var/www
sudo git clone git@github.com:FTC-Ripples-25832/the-ripples.git ripplesftc.com
cd /var/www/ripplesftc.com
echo "NEXT_PUBLIC_SITE_URL=https://www.ripplesftc.com/" > .env
pnpm install
pnpm build
pm2 start ecosystem.config.js
pm2 save