From 9cf2d2cce6d896205aa07c1e9d70fe360030f0f7 Mon Sep 17 00:00:00 2001 From: tlarbals824 Date: Tue, 5 May 2026 15:55:45 +0900 Subject: [PATCH] Avoid apt curl install in runtime image Switch the runtime stage to the Alpine Temurin JRE so the healthcheck can use BusyBox wget already present in the image. This removes apt package downloads from Docker builds.\n\nConstraint: GitHub Actions image builds were spending minutes in apt-get installing curl for healthchecks.\nRejected: Keep Ubuntu Temurin and install curl | preserves the slow apt network path.\nConfidence: high\nScope-risk: narrow\nDirective: Keep container healthchecks dependency-free from apt packages.\nTested: docker manifest inspect eclipse-temurin:25-jre-alpine; git diff --check\nNot-tested: Full docker build --- Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28d1337..b37ac10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,14 +13,12 @@ COPY src ./src RUN gradle bootJar --no-daemon # ===== 실행 스테이지 ===== -FROM eclipse-temurin:25-jre +FROM eclipse-temurin:25-jre-alpine WORKDIR /app COPY --from=build /app/build/libs/*.jar app.jar -RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* - HEALTHCHECK --interval=10s --timeout=5s --start-period=90s --retries=18 \ - CMD curl -f http://localhost:8081/actuator/health/readiness || exit 1 + CMD wget -q -O /dev/null http://127.0.0.1:8081/actuator/health/readiness || exit 1 EXPOSE 8080 -ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-jar", "app.jar"] \ No newline at end of file +ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-jar", "app.jar"]