source ../environment.sh
 

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


docker run --pull always -d \
--name ${STREAM_NAME} \
--network ${NETWORK} \
-p ${STREAM_DEBUG_PORT}:8080 \
--memory ${STREAM_MEMORY} \
-e srs.domain=${SRS_DOMAIN} \
-e srs.name=${SRS_NAME} \
-e recordPath=/data/record/record/ \
-e cangneiwai=true \
-v ${STREAM_DATA}:/data/recording \
-v ${SRS_DATA}:/data/record \
--restart unless-stopped \
${STREAM_IMAGE}