From 850d99225bef3b1550c1bab3201d1b00d41f9c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=B7=9D?= Date: Sat, 28 Feb 2026 11:50:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=B3=A8?= =?UTF-8?q?=E5=85=A5xxljob=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/apprun.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/apprun.sh b/backend/apprun.sh index 7793cea..85fb2b2 100644 --- a/backend/apprun.sh +++ b/backend/apprun.sh @@ -191,12 +191,17 @@ run() { fi checkOrCreate_network containerLogPath=/usr/local/$COMPANY_NAME/logs + PREFIX=${PROJECT_NAME##*-} + XXLJOB_LABEL = "--label \"traefik.enable=true\" \ + --label \"traefik.http.routers.${PREFIX}-router.rule=PathPrefix(\`/${PREFIX}\`)\" \ + --label \"traefik.http.routers.${PREFIX}-router.entrypoints=xxljob\" \ + --label \"traefik.http.services.${PREFIX}-service.loadbalancer.server.port=9999\"" if [ -e "$(pwd)/.env" ];then - docker run -d -v /etc/localtime:/etc/localtime:ro --env-file .env $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME --restart=always --name $PROJECT_NAME $latestImageId - echo "启动命令为: docker run -d -v /etc/localtime:/etc/localtime:ro --env-file .env $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME --restart=always --name $PROJECT_NAME $latestImageId" + docker run -d -v /etc/localtime:/etc/localtime:ro --env-file .env $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME $XXLJOB_LABEL --restart=always --name $PROJECT_NAME $latestImageId + echo "启动命令为: docker run -d -v /etc/localtime:/etc/localtime:ro --env-file .env $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME $XXLJOB_LABEL --restart=always --name $PROJECT_NAME $latestImageId" else - docker run -d -v /etc/localtime:/etc/localtime:ro -e JAVA_OPS="$JAVA_OPS" $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME --restart=always --name $PROJECT_NAME $latestImageId - echo "启动命令为: docker run -d -v /etc/localtime:/etc/localtime:ro -e JAVA_OPS=\"$JAVA_OPS\" $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME --restart=always --name $PROJECT_NAME $latestImageId" + docker run -d -v /etc/localtime:/etc/localtime:ro -e JAVA_OPS="$JAVA_OPS" $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME $XXLJOB_LABEL --restart=always --name $PROJECT_NAME $latestImageId + echo "启动命令为: docker run -d -v /etc/localtime:/etc/localtime:ro -e JAVA_OPS=\"$JAVA_OPS\" $(port_map_processor) -v $LOG_PATH:$containerLogPath --network=$NETWORK_NAME $XXLJOB_LABEL --restart=always --name $PROJECT_NAME $latestImageId" fi }