feat: add HTTP healthcheck endpoint via quarkus-smallrye-health
CI / Build Native (push) Failing after 16m25s

- pom.xml: add quarkus-smallrye-health dependency.
  Exposes /q/health/live and /q/health/ready endpoints (liveness
  and readiness probes for Quarkus apps).
- Dockerfile: install curl-minimal in the microdnf layer so the
  container has a real HTTP client. quarkus-micro-image is based
  on UBI 9 minimal and doesn't ship with curl by default.
- compose.yaml: healthcheck now hits GET /q/health/live with
  curl -f instead of the previous kill -0 1 (which only proved
  the process was alive, not that the HTTP server was responding).

The next CI run will rebuild the native binary with the health
extension baked in; old images pulled from :latest will keep
working since this is additive.
This commit is contained in:
2026-08-13 13:01:20 -04:00
parent 12d382d253
commit d101d6df0f
3 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -2,7 +2,8 @@ FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/ WORKDIR /work/
COPY build-output/shot-crafter-calculator-1.0.0-runner /work/application COPY build-output/shot-crafter-calculator-1.0.0-runner /work/application
RUN chmod 775 /work /work/application \ RUN microdnf install -y curl-minimal && microdnf clean all \
&& chmod 775 /work /work/application \
&& chown -R 1001 /work \ && chown -R 1001 /work \
&& echo "securerandom.source=file:/dev/urandom" >> /work/application && echo "securerandom.source=file:/dev/urandom" >> /work/application
+3 -3
View File
@@ -44,9 +44,9 @@ services:
volumes: volumes:
- shot-crafter-data:/work/data - shot-crafter-data:/work/data
healthcheck: healthcheck:
# La imagen native es PID 1. kill -0 chequea que sigue vivo # curl contra /q/health/live (extension quarkus-smallrye-health).
# sin mandar señal. Devuelve 0 si existe, 1 si no. # Devuelve 200 si la app esta viva. -f falla si el status != 2xx.
test: ["CMD-SHELL", "kill -0 1 || exit 1"] test: ["CMD", "curl", "-fsS", "--max-time", "5", "http://localhost:8080/q/health/live"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3
+4
View File
@@ -68,6 +68,10 @@
<groupId>io.quarkus</groupId> <groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-jwt-build</artifactId> <artifactId>quarkus-smallrye-jwt-build</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency> <dependency>
<groupId>io.quarkus</groupId> <groupId>io.quarkus</groupId>
<artifactId>quarkus-elytron-security-common</artifactId> <artifactId>quarkus-elytron-security-common</artifactId>