Skip to content

[Fix] Docker 이미지 빌드 방식 개선#80

Merged
whc9999 merged 1 commit into
mainfrom
fix/docker
May 26, 2026
Merged

[Fix] Docker 이미지 빌드 방식 개선#80
whc9999 merged 1 commit into
mainfrom
fix/docker

Conversation

@whc9999
Copy link
Copy Markdown
Collaborator

@whc9999 whc9999 commented May 26, 2026

  • Dockerfile 내부 Gradle 빌드를 제거하고 사전 빌드된 bootJar를 이미지에 복사하도록 변경
  • CI Docker Build 단계에서 bootJar 생성 후 Docker 이미지를 빌드하도록 수정
  • Deploy 이미지 빌드 전에도 bootJar를 생성하도록 워크플로우 수정
  • Docker context에 build/libs jar 파일이 포함되도록 .dockerignore 예외 추가
  • Docker 빌드 중 Maven Central 403으로 의존성 다운로드가 실패하던 문제 방지

✨ 어떤 이유로 PR를 하셨나요?

  • feature 병합
  • 버그 수정(아래에 issue #를 남겨주세요)
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요

📸 작업 화면 스크린샷

⚠️ PR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

🚨 관련 이슈 번호 [ ]

Summary by CodeRabbit

  • Chores
    • Upgraded all CI/CD workflows to use JDK 21 for application builds and deployments
    • Refined Docker build context configuration to optimize build efficiency
    • Streamlined Docker container image build process for faster deployment cycles
    • Enhanced build automation with explicit setup steps for improved reliability

Review Change Stack

- Dockerfile 내부 Gradle 빌드를 제거하고 사전 빌드된 bootJar를 이미지에 복사하도록 변경
- CI Docker Build 단계에서 bootJar 생성 후 Docker 이미지를 빌드하도록 수정
- Deploy 이미지 빌드 전에도 bootJar를 생성하도록 워크플로우 수정
- Docker context에 build/libs jar 파일이 포함되도록 .dockerignore 예외 추가
- Docker 빌드 중 Maven Central 403으로 의존성 다운로드가 실패하던 문제 방지
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR relocates the Gradle build process from a Docker multi-stage build to CI/CD workflow steps. The Dockerfile is simplified to a single JRE runtime stage that copies pre-built JARs, .dockerignore is refined to permit JAR artifacts into the Docker build context, and both CI and deploy workflows now execute the Gradle bootJar task before building Docker images.

Changes

Build externalization from Docker to CI/CD

Layer / File(s) Summary
Docker runtime and build context configuration
Dockerfile, .dockerignore
Dockerfile transitions from a multi-stage builder pattern to a single-stage JRE-only runtime image that directly copies build/libs/*.jar from the build context. .dockerignore is updated with targeted rules to allow JAR files through while excluding other build artifacts.
CI and deployment workflow pre-build steps
.github/workflows/ci.yml, .github/workflows/deploy.yml
Both workflows now configure JDK 21 with Gradle caching, grant execute permissions to ./gradlew, and build the application JAR via bootJar (skipping tests) before the Docker image build/push steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 The builder stage has said goodbye,
Now workflows craft the JAR on high.
The Docker takes what's built before,
More lean and fleet than e'er before! 📦✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: improving Docker image build approach by moving the build process out of Dockerfile to CI/CD workflows.
Description check ✅ Passed The PR description includes a comprehensive summary of changes at the top, and properly completes the template with relevant checkboxes marked ('코드 개선' and '코드 수정'). However, the '📋 세부 내용' section lacks elaboration on the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/docker

Comment @coderabbitai help to get the list of available commands and usage tips.

@whc9999 whc9999 merged commit 7de465c into main May 26, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant