How to properly set and manage JVM heap size (-Xms, -Xmx) for a Spring Boot app running in Docker Compose?

I didn’t check the image. My command might even not work properly if an entrypoint script is in place.