I am using Spring-Boot 2.4.4 on a Docker environment managed by a docker-compose.yml file and visualized with portainer. I am building my Docker images with the Spring-Boot build-in builder (with paketo-buildpacks)
mvn spring-boot:build-image
I want to get my Docker container be monitored with spring-actuator. So I add the maven dependency and I got the desired result when I run my application locally and accessing the certain page:
http://localhost:8080/actuator/health
Since I am using the Spring-Boot build-in Docker image builder I have no Dockerfile to add a healthpoint. When I add the healtheck in my docker-compose.yml, the wget command is not found:
healthcheck:
test: wget --spider --quiet 'http://localhost:8080/actuator/health/' || exit 1
interval: 10s
timeout: 3s
retries: 10
start_period: 10s
What am I doing wrong? I could not find any documentation on the web. I thought that Spring-Boot would be able to detect spring-actuator on its own, but I think that it doesn´t.