Initial commit: DataTool backend, frontend and Docker
This commit is contained in:
22
docker/deploy.sh
Normal file
22
docker/deploy.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# DataTool 一键部署:拉取代码 -> 进入 docker 目录 -> 构建并启动
|
||||
# 用法: ./deploy.sh [--no-pull]
|
||||
|
||||
set -e
|
||||
# 脚本在 docker/ 下,仓库根目录为上一级
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
# 可选:跳过拉取(传 --no-pull 时)
|
||||
if [[ "$1" != "--no-pull" ]]; then
|
||||
echo ">>> 拉取最新代码..."
|
||||
git pull || true
|
||||
fi
|
||||
|
||||
echo ">>> 进入 docker 目录并执行构建、启动..."
|
||||
cd "$REPO_ROOT/docker"
|
||||
docker compose build --no-cache
|
||||
docker compose up -d
|
||||
|
||||
echo ">>> 部署完成。访问 http://localhost:8080"
|
||||
Reference in New Issue
Block a user