34 lines
835 B
Bash
34 lines
835 B
Bash
#!/bin/bash
|
|
|
|
echo "=========================================="
|
|
echo "Deploying bert-all-services..."
|
|
echo "=========================================="
|
|
|
|
# 1. 登录阿里云镜像仓库
|
|
echo ""
|
|
echo "[1] Logging into Aliyun Container Registry..."
|
|
echo "a5526801" | docker login \
|
|
--username=dt_1789217881 \
|
|
--password-stdin \
|
|
registry.cn-chengdu.aliyuncs.com
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ Login failed!"
|
|
exit 1
|
|
fi
|
|
echo "✅ Login successful"
|
|
|
|
# 2. 停止并移除旧容器(如果存在)
|
|
echo ""
|
|
echo "[2] Stopping and removing old container..."
|
|
docker compose down 2>/dev/null || echo " No existing container"
|
|
|
|
# 3. 构建并启动
|
|
echo ""
|
|
echo "[3] Building and starting services..."
|
|
docker compose up -d --build
|
|
|
|
# 4. 查看日志
|
|
echo ""
|
|
echo "[4] Showing logs (Ctrl+C to exit)..."
|
|
docker compose logs -f |