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 小时前
经济实惠玩云服务器|一台云服务器多人共用,子账号配置教程
java·linux·运维·服务器·汇编·c++·python
小小、码农9 小时前
Linux进程控制:从fork到exec,手写一个简易Shell
linux·运维·服务器
不会就选b10 小时前
Linux之进程间通信(二)---模拟进程池
linux·运维·服务器
沫璃染墨12 小时前
《从零入门Linux系统篇(十五):系统工具篇·六——GDB调试器详解:从程序执行控制到高级调试技巧》
linux·运维·服务器·c语言·c++
AIgorithmGEEK12 小时前
Linux 环境变量完全指南:从入门到理解底层原理
linux·运维·服务器
修罗王13 小时前
Linux Docker 服务管理与排查实战指南(新手速查版)
运维·docker
迪康Defender13 小时前
从静态存储到动态流转:终端透明加密两种模式实战解析
运维·服务器·网络·数据库·其他
酷可达拉斯13 小时前
Linux操作系统-升级OpenSSH修复漏洞
linux·运维·服务器·云计算
张龙68715 小时前
Docker 镜像瘦身实战:从 1.2GB 到 128MB,我踩过的 7 个坑和一套可复制的方法论
运维·后端·docker
frank006007116 小时前
Dell 17G 服务器阵列卡(PERC)纵向与横向详细对比
运维·服务器