From f748072ae5dd2d0928c75e2e5de3e0b4dcbf4a0a Mon Sep 17 00:00:00 2001 From: Vincenzo Garambone Date: Thu, 11 Jan 2024 17:53:22 +0100 Subject: [PATCH] Add Spring Health Checks --- Dockerfile | 4 +++- VERSION | 2 +- build.gradle | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d491fb..416f7a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,4 +2,6 @@ FROM eclipse-temurin:17 MAINTAINER garambo.it ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} retrosearch.jar -ENTRYPOINT ["java","-jar","/retrosearch.jar"] \ No newline at end of file +ENTRYPOINT ["java","-jar","/retrosearch.jar"] +HEALTHCHECK --interval=30s --timeout=1s \ + CMD curl -f http://localhost:3000/actuator/health || exit 1 diff --git a/VERSION b/VERSION index 8cce38b..616de50 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.1-testing +0.5.2-testing diff --git a/build.gradle b/build.gradle index 8080739..06f9f31 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,7 @@ springBoot { dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.jsoup:jsoup:1.16.2' implementation 'commons-validator:commons-validator:1.7' implementation 'org.apache.httpcomponents:httpclient:4.5.14'