Format and clean up the start.sh script for improved readability and consistency.

This commit is contained in:
liumangmang
2026-02-04 11:30:55 +08:00
parent 4558ef20c0
commit 669dc11064
2 changed files with 17 additions and 15 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# Shell scripts: always LF so ./start.sh works on Linux/WSL
*.sh text eol=lf

View File

@@ -1,15 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
# 脚本所在目录为 docker/,项目根目录为其上级 # 脚本所在目录为 docker/,项目根目录为其上级
ROOT="$(cd "$(dirname "$0")/.." && pwd)" ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT" cd "$ROOT"
echo ">>> 项目根目录: $ROOT" echo ">>> 项目根目录: $ROOT"
echo ">>> 构建并启动..." echo ">>> 构建并启动..."
docker compose -f docker/docker-compose.yml build docker compose -f docker/docker-compose.yml build
docker compose -f docker/docker-compose.yml up -d docker compose -f docker/docker-compose.yml up -d
echo "" echo ""
echo ">>> 已启动。访问: http://localhost:48080" echo ">>> 已启动。访问: http://localhost:48080"
echo ">>> 查看日志: docker compose -f docker/docker-compose.yml logs -f" echo ">>> 查看日志: docker compose -f docker/docker-compose.yml logs -f"