[ISSUE-150] Add Spring Boot Actuator Health Check Endpoints for portainer-automation Service #163
@ -36,3 +36,6 @@ ENV=dev
|
|||||||
|
|
||||||
# Host port to map to container port 8081
|
# Host port to map to container port 8081
|
||||||
HOST_PORT=8081
|
HOST_PORT=8081
|
||||||
|
|
||||||
|
# Host port to map to actuator management port 8082 (health checks, LAN only)
|
||||||
|
MGMT_PORT=5005
|
||||||
|
|||||||
@ -9,4 +9,5 @@ RUN ./gradlew :portainer-automation:bootJar
|
|||||||
|
|
||||||
FROM openjdk:17-jdk-slim
|
FROM openjdk:17-jdk-slim
|
||||||
COPY --from=build /app/portainer-automation/build/libs/*.jar app.jar
|
COPY --from=build /app/portainer-automation/build/libs/*.jar app.jar
|
||||||
|
EXPOSE 8081 8082
|
||||||
|
hitanshu marked this conversation as resolved
|
|||||||
ENTRYPOINT ["java", "-jar", "/app.jar"]
|
ENTRYPOINT ["java", "-jar", "/app.jar"]
|
||||||
|
|||||||
@ -5,6 +5,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
implementation 'org.apache.httpcomponents.client5:httpclient5'
|
implementation 'org.apache.httpcomponents.client5:httpclient5'
|
||||||
|
|
||||||
compileOnly 'org.projectlombok:lombok'
|
compileOnly 'org.projectlombok:lombok'
|
||||||
|
|||||||
@ -3,7 +3,8 @@ services:
|
|||||||
image: gitea.hithomelabs.com/hithomelabs/portainer-automation:${ENV:-test}
|
image: gitea.hithomelabs.com/hithomelabs/portainer-automation:${ENV:-test}
|
||||||
container_name: portainer-automation_${ENV:-test}
|
container_name: portainer-automation_${ENV:-test}
|
||||||
ports:
|
ports:
|
||||||
- "${HOST_PORT:-8081}:8081"
|
- "${HOST_PORT:-8081}:8081" # Application port (internal service)
|
||||||
|
- "${MGMT_PORT:-5005}:8082" # Health management port (LAN only)
|
||||||
|
hitanshu marked this conversation as resolved
Linus
commented
`${MGMT_PORT:-5005}:8082` mapping correct — keeps 5005 as recommended in my review of #150. Note: 5004 occupancy (cftunnels runtime override) is still unverified in-repo; confirm with `ss -tlnp | grep 5004` at deploy time before enabling the Uptime Kuma monitor.
|
|||||||
environment:
|
environment:
|
||||||
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE:-local}
|
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE:-local}
|
||||||
- PORTAINER_API_KEY=${PORTAINER_API_KEY}
|
- PORTAINER_API_KEY=${PORTAINER_API_KEY}
|
||||||
|
|||||||
@ -3,3 +3,9 @@ portainer.base-url=https://192.168.0.100:9442
|
|||||||
portainer.api-key=${PORTAINER_API_KEY:}
|
portainer.api-key=${PORTAINER_API_KEY:}
|
||||||
portainer.endpoint-id=1
|
portainer.endpoint-id=1
|
||||||
portainer.service.api-key=${PORTAINER_SERVICE_API_KEY:change-me}
|
portainer.service.api-key=${PORTAINER_SERVICE_API_KEY:change-me}
|
||||||
|
|
||||||
|
# Actuator configuration - management port and exposed endpoints
|
||||||
|
# App runs on server.port=8081, so management port must differ (8082)
|
||||||
|
management.server.port=8082
|
||||||
|
management.endpoints.web.exposure.include=health,info
|
||||||
|
hitanshu marked this conversation as resolved
Linus
commented
`show-details=when-authorized` — with no Spring Security in this service, health details will never be rendered for unauthenticated callers, which matches the minimal-exposure intent. Good. Optional follow-up (non-blocking): add a Portainer HealthIndicator so /actuator/health reflects Portainer reachability, mirroring #149.
|
|||||||
|
management.endpoint.health.show-details=when-authorized
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user
EXPOSE 8081 8082correctly ADDED — this Dockerfile previously had no EXPOSE lines (matches my review finding #2). Non-blocking: EXPOSE is informational; the compose port mapping is authoritative, and both are in place.