Files
web/restart.sh

15 lines
567 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 仅重启项目(不拉代码),适用于配置/环境变更后重启
# 行尾LF.gitattributes
# 用法cd /home/yxd/project/yh_web && ./restart.sh
# 或PROJECT_ROOT=/home/yxd/project/yh_web ./restart.sh
set -e
ROOT="${PROJECT_ROOT:-$(cd "$(dirname "$0")" && pwd)}"
cd "$ROOT"
echo "重启 yh_web ($ROOT)..."
[ -f server/.env ] && set -a && source server/.env && set +a
docker compose down 2>/dev/null || docker-compose down
docker compose up -d 2>/dev/null || docker-compose up -d
echo "完成. api:9527 web:9528 admin:9529"