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>
相关推荐
人工智能训练6 小时前
【极速部署】Ubuntu24.04+CUDA13.0 玩转 VLLM 0.15.0:预编译 Wheel 包 GPU 版安装全攻略
运维·前端·人工智能·python·ai编程·cuda·vllm
微露清风7 小时前
系统性学习Linux-第二讲-基础开发工具
linux·运维·学习
阳光九叶草LXGZXJ8 小时前
达梦数据库-学习-48-DmDrs控制台命令(同步之Manager、CPT模块)
linux·运维·数据库·sql·学习
小二李9 小时前
第11章 nestjs服务端开发:登录鉴权
运维·服务器
i建模10 小时前
如何在Arch Linux中重设忘记的root密码
linux·运维·服务器
chatexcel11 小时前
元空AI+Clawdbot:7×24 AI办公智能体新形态详解(长期上下文/自动化任务/工具粘合)
运维·人工智能·自动化
kida_yuan11 小时前
【Linux】运维实战笔记 — 我常用的方法与命令
linux·运维·笔记
小陈phd12 小时前
混合知识库搭建:本地Docker部署Neo4j图数据库与Milvus向量库
数据库·docker·neo4j
Wpa.wk13 小时前
容器编排 - 了解K8s(pod, deployment,service,lable等概念)
经验分享·测试工具·docker·云原生·容器·kubernetes
何中应13 小时前
vmware的linux虚拟机如何设置以命令行方式启动
linux·运维·服务器