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>
相关推荐
雪可问春风19 小时前
docker环境部署
运维·docker·容器
lwx91485219 小时前
Linux-Shell算术运算
linux·运维·服务器
翻斗包菜19 小时前
PostgreSQL 日常维护完全指南:从基础操作到高级运维
运维·数据库·postgresql
somi719 小时前
ARM-驱动-02-Linux 内核开发环境搭建与编译
linux·运维·arm开发
双份浓缩馥芮白19 小时前
【Docker】Linux 迁移 docker 目录(软链接)
linux·docker
海的透彻20 小时前
nginx启动进程对文件的权限掌控
运维·chrome·nginx
路溪非溪20 小时前
Linux驱动开发中的常用接口总结(一)
linux·运维·驱动开发
航Hang*20 小时前
第3章:Linux系统安全管理——第2节:部署代理服务
linux·运维·服务器·开发语言·笔记·系统安全
北方的流星21 小时前
华三网络设备的路由重定向配置
运维·网络·华三
河南博为智能科技有限公司21 小时前
蓄电池在线监测系统-守护数据中心安全防线
运维·边缘计算