This commit is contained in:
@@ -25,7 +25,8 @@ COPY app.py .
|
||||
EXPOSE 80
|
||||
|
||||
# 添加健康检查(v2.0+ 特性)
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost/health || exit 1
|
||||
# 注意:v1.0 版本没有 /health 端点,不应添加健康检查
|
||||
# HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
|
||||
# CMD wget --no-verbose --tries=1 --spider http://localhost/health || exit 1
|
||||
|
||||
CMD ["python", "app.py"]
|
||||
|
||||
Reference in New Issue
Block a user