Files
banu-front/deploy.sh
T
Server Migration 3d005859ab
Deploy banu-front / deploy (push) Waiting to run
fix: remove old-server frontend references
2026-08-04 18:43:12 +00:00

34 lines
772 B
Bash

#!/bin/bash
set -e
REPO="ssh://git@git.meshkee.com:222/sajjad.talkhabi/test.git"
APP_DIR="/root/banu-front"
IMAGE="banu-front"
CONTAINER="banu-front"
PORT="8080"
VITE_API_BASE_URL="//api.madresebanoo.ir/api"
echo "==> Pulling latest code..."
if [ -d "$APP_DIR/.git" ]; then
git -C "$APP_DIR" pull
else
git clone "$REPO" "$APP_DIR"
fi
echo "==> Building Docker image..."
docker build \
--build-arg VITE_API_BASE_URL="$VITE_API_BASE_URL" \
-t "$IMAGE" "$APP_DIR"
echo "==> Stopping old container..."
docker rm -f "$CONTAINER" 2>/dev/null || true
echo "==> Starting new container..."
docker run -d \
--name "$CONTAINER" \
--restart unless-stopped \
-p "$PORT:80" \
"$IMAGE"
echo "==> Done. App running at http://$(hostname -I | awk '{print $1}'):$PORT"