--- services: demo: image: localhost/spring-boot-demo:latest build: dockerfile: Dockerfile context: . env_file: - .env expose: - 8080 - 8081 command: - app.jar healthcheck: test: [ "CMD", "curl", "--fail", "--silent", "http://localhost:8081/health" ] interval: 30s timeout: 10s retries: 5 start_period: 10s