Files
AIeffect/scripts/docker-up.sh
2026-04-01 17:28:39 +08:00

23 lines
620 B
Bash
Executable File
Raw Permalink 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
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${PROJECT_ROOT}"
if docker compose version >/dev/null 2>&1; then
COMPOSE_CMD=(docker compose)
elif command -v docker-compose >/dev/null 2>&1; then
COMPOSE_CMD=(docker-compose)
else
echo "未找到 docker compose / docker-compose请先安装 Docker Desktop。"
exit 1
fi
echo "使用国内镜像源构建并启动容器..."
"${COMPOSE_CMD[@]}" build --pull
"${COMPOSE_CMD[@]}" up -d
echo "启动完成。"
echo "访问地址: http://localhost:5173"
echo "查看日志: ${COMPOSE_CMD[*]} logs -f web"