source ../environment.sh
 
 # 获取 NGINX 容器的 IP 地址
NGINX_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${NGINX_NAME})
if [ -z "$NGINX_IP" ]; then
    echo "错误：无法获取 ${NGINX_NAME} 容器的 IP 地址"
fi
echo "获取到 ${NGINX_NAME} 容器的 IP 地址: ${NGINX_IP}"

if docker ps -a | grep -q ${HHZ_ADMIN_NAME}; then
    echo "停止并删除已存在的 HHZ_ADMIN_NAME 容器..."
    docker stop ${HHZ_ADMIN_NAME} >/dev/null 2>&1
    docker rm ${HHZ_ADMIN_NAME} >/dev/null 2>&1
fi


docker run --pull always -d \
--name ${HHZ_ADMIN_NAME} \
--network ${NETWORK} \
--env SPRING_CLOUD_CONSUL_HOST=${CONSUL_NAME} \
--env SPRING_CLOUD_CONSUL_PORT=8500 \
--env SPRING_CLOUD_CONSUL_DISCOVERY_HOSTNAME=${HHZ_ADMIN_NAME} \
--env XXL_JOB_ADMIN_ADDRESSES=http://${XXLJOB_NAME}:8080/xxl-job-admin \
--env XXL_JOB_ACCESSTOKEN=${XXLJOB_ACCESS_TOKEN} \
--env XXL_ENABLE=true \
--env SPRING_REDIS_HOST=${REDIS_NAME} \
--env SPRING_REDIS_PORT=6379 \
--env SPRING_DATASOURCE_URL="jdbc:mysql://${MYSQL_NAME}:3306/tuoheng_hhz?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false" \
--env SPRING_DATASOURCE_USERNAME=root \
--env SPRING_DATASOURCE_PASSWORD=${MYSQL_ROOT_PASSWORD} \
--env SPRING_MQTT_ONLINEURL=tcp://${MQTT_NAME}:1883 \
--env SPRING_MQTT_URL=tcp://${MQTT_NAME}:1883 \
--env SPRING_MQTT_NEWURL=tcp://${MQTT_NAME}:1883 \
--env SPRING_NEWMQTT_ONLINEURL=tcp://${MQTT_NAME}:1883 \
--env SPRING_NEWMQTT_URL=tcp://${MQTT_NAME}:1883 \
--env SPRING_NEWMQTT_NEWURL=tcp://${MQTT_NAME}:1883 \
--env VIDEOSERVER_REQUESTURL=http://${STREAM_NAME}:8080 \
--env VIDEOSERVER_VIDEOPLAYURL=https://${SRS_DOMAIN}:${NGINX_HTTPS_PORT}/recording/ \
--env SPRING_KAFKA_BOOTSTRAP_SERVERS=${KAFKA_NAME}:${KAFKA_PORT} \
--env MINIO_OSS_ENDPOINT=http://${MINIO_NAME}:9000 \
--env MINIO_OSS_OUTENDPOINT=https://${MINIO_DOMAIN}:${NGINX_HTTPS_PORT} \
--env MINIO_DAJIOSS_ENDPOINT=https://${MINIO_DOMAIN}:${NGINX_HTTPS_PORT} \
--env MINIO_OSS_ACCESSKEYID=${MINIO_ACCESS_KEY} \
--env MINIO_OSS_ACCESSKEYSECRET=${MINIO_SECRET_KEY} \
--env TUOHENG_DSP_CALLBACK_URL=https://${HHZ_DOMAIN_FULL}/hhz/admin/dsp/{requestId}/callback \
--env TUOHENG_DSP_DOMAIN_URL=https://${DSP_DOMAIN_FULL}/ \
--env TUOHENG_OIDC-URL=https://${OIDC_ADMIN_DOMAIN_FULL} \
--env TZ=Asia/Shanghai \
--add-host ${OIDC_ADMIN_DOMAIN}:host-gateway \
--add-host ${DSP_DOMAIN}:host-gateway \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--memory ${HHZ_ADMIN_MEMORY} \
--restart unless-stopped \
${HHZ_ADMIN_IMAGE}

#  下面这句话
# --env TUOHENG_DSP_DOMAIN_URL=http://${DSP_API_NAME}:9015/ \
 
 