Commit 4f378c12 authored by 智勇's avatar 智勇

ui 增加健康检查

parent c92eb63b
......@@ -29,6 +29,7 @@ RUN echo -e "${BUILD_SCHEMA//@/\n}" >> ./build_info
COPY --from=0 /code/* /home/quant_group/
COPY readyCheck.sh .
COPY docker-entrypoint.sh .
RUN chmod +x ./docker-entrypoint.sh
CMD ./docker-entrypoint.sh
\ No newline at end of file
#!/bin/bash
# 就绪检查, 返回0表示就绪
# 请求http://localhost:80
# status 返回5xx or 000 启动中(未就绪)
# 返回404 未实现该接口,认为就绪
# 返回2xx, 就绪
# 其他, 就绪
statusCode=`curl -I -o /dev/null -s -w %{http_code} http://localhost
echo "statusCode: ${statusCode}"
statusCodeFirst="${statusCode:0:1}"
echo "statusCodeFirst: ${statusCodeFirst}"
READY=0
UNREADY=1
if [ ${statusCodeFirst} = "5" -o ${statusCodeFirst} = "0" ]
then
exit ${UNREADY}
fi
exit ${READY}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment