-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_to_vps.sh
More file actions
executable file
·35 lines (30 loc) · 1 KB
/
deploy_to_vps.sh
File metadata and controls
executable file
·35 lines (30 loc) · 1 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
#!/usr/bin/env bash
set -e
VPS_IP="109.120.134.188"
VPS_USER="admin"
VPS_PORT="2202"
REMOTE_DIR="/opt/dubtab"
LOCAL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
echo "========================================="
echo " Deploying DubTab to VPS ($VPS_IP)"
echo "========================================="
echo "→ Syncing files to VPS..."
rsync -avz --progress \
--exclude '.git' \
--exclude 'node_modules' \
--exclude 'frontend/node_modules' \
--exclude 'frontend/dist' \
--exclude 'backend/venv' \
--exclude '__pycache__' \
--exclude 'data' \
--exclude '*.tar.gz' \
-e "ssh -i ~/.ssh/dubtab_deploy -p $VPS_PORT -o StrictHostKeyChecking=no" \
"$LOCAL_DIR/" \
"$VPS_USER@$VPS_IP:$REMOTE_DIR"
echo "→ Rebuilding Docker containers on VPS..."
ssh -i ~/.ssh/dubtab_deploy -p "$VPS_PORT" -o StrictHostKeyChecking=no "$VPS_USER@$VPS_IP" \
"cd $REMOTE_DIR && docker compose up -d --build"
echo ""
echo "✅ Done!"
echo " Frontend: https://dubtab.app"
echo " Backend: http://$VPS_IP:8555"