testing app checks

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2024-10-01 00:56:23 +02:00
parent e2ec23400f
commit 0a731af40a
3 changed files with 22 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ USER app
# Copy pom.xml and prefetch dependencies so a repeated build can continue from the next step with existing dependencies # Copy pom.xml and prefetch dependencies so a repeated build can continue from the next step with existing dependencies
COPY --chown=app ${SERVICE_ROOT}/gradle/ ./gradle COPY --chown=app ${SERVICE_ROOT}/gradle/ ./gradle
COPY --chown=app ${SERVICE_ROOT}/gradlew ${SERVICE_ROOT}/build.gradle ${SERVICE_ROOT}/settings.gradle ./ COPY --chown=app ${SERVICE_ROOT}/gradlew ${SERVICE_ROOT}/build.gradle ${SERVICE_ROOT}/settings.gradle ${SERVICE_ROOT}/app.json ./
# Copy all needed project files to a folder # Copy all needed project files to a folder
COPY --chown=app:app ${SERVICE_ROOT}/src ./src COPY --chown=app:app ${SERVICE_ROOT}/src ./src

15
app.json Normal file
View File

@@ -0,0 +1,15 @@
{
"healthchecks": {
"web": [
{
"type": "readiness",
"name": "web check",
"description": "Checking if the app responds to the /actuator/health/readiness endpoint",
"path": "/actuator/health/readiness",
"initialDelay": 20,
"port": 8080,
"attempts": 3
}
]
}
}

View File

@@ -14,6 +14,12 @@ info:
spring-cloud-version: '@spring-cloud.version@' spring-cloud-version: '@spring-cloud.version@'
spring-boot-version: '@project.parent.version@' spring-boot-version: '@project.parent.version@'
management:
endpoint:
health:
probes:
enabled: true
server: server:
port: ${PORT:8080} port: ${PORT:8080}
shutdown: graceful shutdown: graceful