fix docker build error

This commit is contained in:
itfisher
2025-10-29 22:38:04 +08:00
parent ed67aa04d7
commit 201600f874
2 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
# Multi-stage build for NOFX AI Trading System # Multi-stage build for NOFX AI Trading System
FROM golang:1.24-alpine AS backend-builder FROM golang:1.25-alpine AS backend-builder
# Install build dependencies including TA-Lib # Install build dependencies including TA-Lib
RUN apk add --no-cache \ RUN apk add --no-cache \

View File

@@ -36,7 +36,7 @@ check_docker() {
exit 1 exit 1
fi fi
if ! command -v docker-compose &> /dev/null; then if ! command -v docker compose &> /dev/null; then
print_error "Docker Compose 未安装!请先安装 Docker Compose" print_error "Docker Compose 未安装!请先安装 Docker Compose"
exit 1 exit 1
fi fi
@@ -64,7 +64,7 @@ start() {
print_info "重新构建镜像..." print_info "重新构建镜像..."
docker-compose up -d --build docker-compose up -d --build
else else
docker-compose up -d docker compose up -d
fi fi
print_success "服务已启动!" print_success "服务已启动!"
@@ -78,30 +78,30 @@ start() {
# 停止服务 # 停止服务
stop() { stop() {
print_info "正在停止服务..." print_info "正在停止服务..."
docker-compose stop docker compose stop
print_success "服务已停止" print_success "服务已停止"
} }
# 重启服务 # 重启服务
restart() { restart() {
print_info "正在重启服务..." print_info "正在重启服务..."
docker-compose restart docker compose restart
print_success "服务已重启" print_success "服务已重启"
} }
# 查看日志 # 查看日志
logs() { logs() {
if [ -z "$2" ]; then if [ -z "$2" ]; then
docker-compose logs -f docker compose logs -f
else else
docker-compose logs -f "$2" docker compose logs -f "$2"
fi fi
} }
# 查看状态 # 查看状态
status() { status() {
print_info "服务状态:" print_info "服务状态:"
docker-compose ps docker compose ps
echo "" echo ""
print_info "健康检查:" print_info "健康检查:"
curl -s http://localhost:8080/health | jq '.' || echo "后端未响应" curl -s http://localhost:8080/health | jq '.' || echo "后端未响应"
@@ -113,7 +113,7 @@ clean() {
read -p "确认删除?(yes/no): " confirm read -p "确认删除?(yes/no): " confirm
if [ "$confirm" == "yes" ]; then if [ "$confirm" == "yes" ]; then
print_info "正在清理..." print_info "正在清理..."
docker-compose down -v docker compose down -v
print_success "清理完成" print_success "清理完成"
else else
print_info "已取消" print_info "已取消"
@@ -124,7 +124,7 @@ clean() {
update() { update() {
print_info "正在更新..." print_info "正在更新..."
git pull git pull
docker-compose up -d --build docker compose up -d --build
print_success "更新完成" print_success "更新完成"
} }