增加自动注入xxljob配置

This commit is contained in:
王川
2026-02-28 12:40:45 +08:00
parent 081c65ceb3
commit ecd8570414

View File

@@ -192,10 +192,10 @@ run() {
checkOrCreate_network checkOrCreate_network
containerLogPath=/usr/local/$COMPANY_NAME/logs containerLogPath=/usr/local/$COMPANY_NAME/logs
PREFIX=${PROJECT_NAME##*-} PREFIX=${PROJECT_NAME##*-}
XXLJOB_LABEL="--label \"traefik.enable=true\" \ XXLJOB_LABEL="--label traefik.enable=true \
--label \"traefik.http.routers.${PREFIX}-router.rule=PathPrefix(\`/${PREFIX}\`)\" \ --label traefik.http.routers.${PREFIX}-router.rule=PathPrefix(\`/${PREFIX}\`) \
--label \"traefik.http.routers.${PREFIX}-router.entrypoints=xxljob\" \ --label traefik.http.routers.${PREFIX}-router.entrypoints=xxljob \
--label \"traefik.http.services.${PREFIX}-service.loadbalancer.server.port=9999\"" --label traefik.http.services.${PREFIX}-service.loadbalancer.server.port=9999"
if [ -e "$(pwd)/.env" ];then 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 $XXLJOB_LABEL --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" 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"