Skip to content

Commit

Permalink
adjust health check
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 20, 2024
1 parent 0fa166f commit 0e567ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion generators/docker/templates/docker/app.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,16 @@ _%>
<%_ if (cacheProviderInfinispan) { _%>
- JAVA_OPTS=-Djgroups.tcp.address=NON_LOOPBACK -Djava.net.preferIPv4Stack=true
<%_ } _%>
- THC_PORT=<%= serverPort %>
- THC_PATH=/management/health
<%_ if (applicationTypeMonolith || applicationTypeGateway) { _%>
# If you want to expose these ports outside your dev PC,
# remove the "127.0.0.1:" prefix
ports:
- 127.0.0.1:<%= serverPort %>:<%= serverPort %>
<%_ } _%>
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:<%= serverPort %>/management/health']
test: ['CMD', '/workspace/health-check']
interval: 5s
timeout: 5s
retries: 40
6 changes: 5 additions & 1 deletion generators/spring-boot/templates/build.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,14 @@ task cleanResources(type: Delete) {

bootBuildImage {
builder = "paketobuildpacks/builder-jammy-buildpackless-tiny"
buildpacks = ["paketobuildpacks/java"]
buildpacks = [
"paketobuildpacks/java",
"paketobuildpacks/health-checker"
]
tags = ["<%- lowercaseBaseName %>"]
environment = [
"BPL_SPRING_AOT_ENABLED" : "true",
"BP_HEALTH_CHECKER_ENABLED" : "true",
"BP_JVM_CDS_ENABLED" : "false",
"BP_JVM_VERSION": "<%= JAVA_VERSION %>"
]
Expand Down
2 changes: 2 additions & 0 deletions generators/spring-boot/templates/pom.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,14 @@
<builder>paketobuildpacks/builder-jammy-buildpackless-tiny</builder>
<buildpacks>
<buildpack>paketobuildpacks/java</buildpack>
<buildpack>paketobuildpacks/health-checker</buildpack>
</buildpacks>
<tags>
<tag><%- lowercaseBaseName %></tag>
</tags>
<env>
<BPL_SPRING_AOT_ENABLED>true</BPL_SPRING_AOT_ENABLED>
<BP_HEALTH_CHECKER_ENABLED>true</BP_HEALTH_CHECKER_ENABLED>
<BP_JVM_CDS_ENABLED>false</BP_JVM_CDS_ENABLED>
<BP_JVM_VERSION>${java.version}</BP_JVM_VERSION>
</env>
Expand Down

0 comments on commit 0e567ae

Please sign in to comment.