docker健康检查使用

docker健康检查:

Springboot程序部分:
context-path与base-path拼接使用: test: ["CMD", "curl", "-f", "http://localhost:8080/path/api/actuator/health"],

yml 复制代码
# 服务器配置
server:
  port: ${SERVER_PORT:8080}
  servlet:
    context-path: /path/api
# Actuator 健康检查配置
management:
  endpoints:
    web:
      exposure:
        include: health,info
      base-path: /actuator
  endpoint:
    health:
      show-details: always
  health:
    db:
      enabled: true

pom依赖:

xml 复制代码
<!-- Spring Boot Actuator (健康检查) -->
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
相关推荐
昊星自动化10 小时前
昊星自动化携关键环境气流控制方案亮相山东实验室建设论坛,为实验室安全与低碳环保双向赋能
运维·安全·自动化
芊&星10 小时前
靶机应急 | 知攻善防----Windows
运维·windows·安全
ABILI .10 小时前
Linux上安装部署k8s单机版(minikube)
linux·运维·kubernetes
量子炒饭大师10 小时前
【Linux系统编程】——【自动化构建-make/Makefile】拒绝手动编译!构建你的赛博代码加工厂,重塑逻辑矩阵效率极限
linux·运维·自动化·makefile·make·自动化构建
xiaogg367810 小时前
k8s 部署yaml文件和Dockerfile文件配置
java·docker·kubernetes
_codemonster10 小时前
测试用例怎么写
运维·服务器·测试用例
eggrall10 小时前
Linux信号——信号产生
linux·运维·服务器
日取其半万世不竭11 小时前
Docker 网络模式详解:bridge、host、overlay 和 macvlan
网络·docker·容器
张道宁11 小时前
从零搭建化工园区 AI 安防监控系统:技术方案、落地实现与工程反思
运维·服务器
ZGUIZ11 小时前
Ubuntu 25.10 蓝牙Wifi不可用解决流程
linux·运维·ubuntu