From 3bd7f74a77edc7060ba2ab480d3e18d251346bd8 Mon Sep 17 00:00:00 2001 From: dahoud Date: Thu, 23 Oct 2025 15:26:11 +0000 Subject: [PATCH] Fix: Correct Dockerfile HEALTHCHECK and Swagger UI URL for root-path configuration - Fixed HEALTHCHECK to use /btpxpress/q/health/ready instead of /q/health/ready - Added quarkus.swagger-ui.urls.default=/btpxpress/openapi for correct OpenAPI loading - Ensures Swagger UI loads the spec from the correct path with root-path These fixes ensure: 1. Docker health checks work correctly with quarkus.http.root-path=/btpxpress 2. Swagger UI correctly loads /btpxpress/openapi instead of /openapi 3. Pods are marked healthy by Kubernetes Resolves the 404 error in Swagger UI when loading API definition. --- Dockerfile | 2 +- src/main/resources/application-prod.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c60a30e..996aba3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ - CMD curl -f http://localhost:8080/q/health/ready || exit 1 + CMD curl -f http://localhost:8080/btpxpress/q/health/ready || exit 1 ENTRYPOINT [ "java", "-jar", "/deployments/app.jar" ] diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 0e6d214..5f6d739 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -79,6 +79,7 @@ quarkus.datasource.jdbc.leak-detection-interval=PT10M # OpenAPI/Swagger quarkus.swagger-ui.always-include=true quarkus.swagger-ui.path=/swagger-ui +quarkus.swagger-ui.urls.default=/btpxpress/openapi quarkus.smallrye-openapi.path=/openapi quarkus.smallrye-openapi.info-title=BTP Xpress API quarkus.smallrye-openapi.info-version=1.0.0