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>
相关推荐
无足鸟ICT13 小时前
【RHCA+】sosreport(收集诊断文档)
linux·运维·服务器
IT大白鼠14 小时前
当 AI 开始自动化渗透:FBI ARTEX 警报的防守对策
运维·人工智能·自动化
Decay__14 小时前
SQLServer 运维自动化平台 —— PowerShell + SQL Agent 作业:部署、监控、巡检、告警、工单闭环一体化
运维·数据库·sql·mysql·架构
A-刘晨阳15 小时前
K8S 二进制集群搭建(一主两从)v1.37.2 版本
运维·云原生·容器·kubernetes·calico·nerdctl
tonydf15 小时前
没完了,Nginx又报新漏洞!
运维·nginx
瑞雪兆丰年兮16 小时前
Linux零基础快速入门-第二章 Linux基础命令
linux·运维·服务器
lambo mercy16 小时前
01初识docker
运维·docker·容器
时间的拾荒人17 小时前
Docker 容器、仓库与数据管理实战
docker·容器·eureka
时间的拾荒人19 小时前
Docker 入门实战:从核心概念、安装配置到镜像操作与 Dockerfile 定制
运维·docker·容器·eureka
光电笑映19 小时前
TCP 为什么可靠?从三次握手、滑动窗口到拥塞控制全面拆解(上)
运维·服务器·网络·udp