From 7201033b7d8bef9a7bb57e016da1947f5207e1c4 Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Fri, 20 Sep 2024 19:37:19 -0300 Subject: [PATCH] adjust health check --- generators/docker/templates/docker/app.yml.ejs | 2 +- generators/spring-boot/templates/build.gradle.ejs | 5 ++++- generators/spring-boot/templates/pom.xml.ejs | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/generators/docker/templates/docker/app.yml.ejs b/generators/docker/templates/docker/app.yml.ejs index c7d90b5c61cc..d5dd686bde4f 100644 --- a/generators/docker/templates/docker/app.yml.ejs +++ b/generators/docker/templates/docker/app.yml.ejs @@ -102,7 +102,7 @@ _%> - 127.0.0.1:<%= serverPort %>:<%= serverPort %> <%_ } _%> healthcheck: - test: ['CMD', 'curl', '-f', 'http://localhost:<%= serverPort %>/management/health'] + test: ['CMD-SHELL', 'THC_PORT=<%= serverPort %> THC_PATH=/management/health /workspace/health-check'] interval: 5s timeout: 5s retries: 40 diff --git a/generators/spring-boot/templates/build.gradle.ejs b/generators/spring-boot/templates/build.gradle.ejs index 68bd8d831a89..8f4a60eb9844 100644 --- a/generators/spring-boot/templates/build.gradle.ejs +++ b/generators/spring-boot/templates/build.gradle.ejs @@ -267,7 +267,10 @@ task cleanResources(type: Delete) { bootBuildImage { builder = "paketobuildpacks/builder-jammy-buildpackless-tiny" buildpacks = ["paketobuildpacks/java"] - tags = ["<%- lowercaseBaseName %>"] + tags = [ + "<%- lowercaseBaseName %>" + "paketobuildpacks/health-checker" + ] environment = [ "BPL_SPRING_AOT_ENABLED" : "true", "BP_JVM_CDS_ENABLED" : "false", diff --git a/generators/spring-boot/templates/pom.xml.ejs b/generators/spring-boot/templates/pom.xml.ejs index 329a07e7a3ef..bd465709d9af 100644 --- a/generators/spring-boot/templates/pom.xml.ejs +++ b/generators/spring-boot/templates/pom.xml.ejs @@ -541,6 +541,7 @@ paketobuildpacks/builder-jammy-buildpackless-tiny paketobuildpacks/java + paketobuildpacks/health-checker <%- lowercaseBaseName %>