Skip to content

build: add Spring Boot Buildpacks support - #554

Open
yashdotdev13 wants to merge 3 commits into
spring-petclinic:mainfrom
yashdotdev13:feat/248-docker-buildpacks
Open

build: add Spring Boot Buildpacks support#554
yashdotdev13 wants to merge 3 commits into
spring-petclinic:mainfrom
yashdotdev13:feat/248-docker-buildpacks

Conversation

@yashdotdev13

Copy link
Copy Markdown

Description

Fixes #248

Adds Spring Boot Cloud Native Buildpacks support while preserving the existing Dockerfile-based buildDocker workflow. Also replaces the curl-based Compose health checks with the Paketo health-checker used by Buildpacks images.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Dependency upgrade

Changes

  • Added a buildImage Maven profile using Spring Boot's build-image-no-fork goal.
  • Added Paketo's health-checker buildpack and enabled the health checker.
  • Replaced curl health checks in docker-compose.yml with /workspace/health-check.
  • Added THC_PORT and THC_PATH configuration for the config and discovery servers.
  • Documented the new ./mvnw clean install -PbuildImage workflow in the README.
  • Kept the existing buildDocker profile unchanged.

Validation

  • ./mvnw validate -PbuildImage — passed
  • docker compose config — passed
  • git diff --check — passed
  • Buildpacks image creation was validated locally.

Checklist

  • I have read the CONTRIBUTING guide
  • This is NOT coursework, a course assignment, or homework
  • My change targets the main branch of spring-petclinic/spring-petclinic-microservices, not my own fork
  • I have tested this change locally
  • Existing tests pass (./mvnw test) — not run as part of this change

The implementation follows issue #248 and keeps the existing Dockerfile-based workflow available alongside Buildpacks.

Comment thread docker-compose.yml
THC_PATH: /
healthcheck:
test: ["CMD", "curl", "-I", "http://config-server:8888"]
test: ["CMD", "/workspace/health-check"]

@arey arey Aug 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question Is this change compatible with the existing Dockerfile?
I don't think they have this paketo health checker

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. You're right — changing the shared Compose health check to /workspace/health-check assumes that the existing Dockerfile-built images also contain the Paketo health checker. I'll verify the existing workflow and update the implementation so that the buildDocker workflow remains compatible.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could align both versions with the same URL.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Do you mean aligning the health check target between the existing Dockerfile-built images and the Buildpack-built images by using the same health endpoint path/URL, while keeping the Buildpack-specific internal port configuration where required?

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Docker Buildpacks image support from Spring Boot

2 participants