This commit is contained in:
parent
1a9fd9467e
commit
1bac55cf54
@ -5,4 +5,4 @@ RUN apk add --no-cache supervisor bash
|
|||||||
COPY supervisor /etc/supervisor
|
COPY supervisor /etc/supervisor
|
||||||
COPY scripts /scripts
|
COPY scripts /scripts
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord"]
|
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]
|
||||||
|
@ -3,8 +3,19 @@
|
|||||||
echo "新闻播报服务启动中..."
|
echo "新闻播报服务启动中..."
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
# 模拟每5秒输出一次新闻头条
|
# 获取当前时间
|
||||||
echo "[新闻播报] 当前时间: $(date '+%Y-%m-%d %H:%M:%S'),头条:今日科技新闻,新型AI技术发布!"
|
current_time=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
|
# 构建JSON格式的日志
|
||||||
|
json_log=$(cat << EOF
|
||||||
|
{
|
||||||
|
"service": "新闻播报",
|
||||||
|
"timestamp": "$current_time",
|
||||||
|
"headline": "今日科技新闻,新型AI技术发布!"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
# 输出JSON格式的日志
|
||||||
|
echo "$json_log"
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user