-
Notifications
You must be signed in to change notification settings - Fork 0
[RELEASE] v2.2.2 GitHub Actions Gradle 중복 빌드 제거 #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| .git | ||
| .gitignore | ||
| *.md | ||
| build/ | ||
| src/test/ | ||
| src/ | ||
| .gradle/ | ||
| .idea/ | ||
| .DS_Store | ||
| */.DS_Store | ||
| .env | ||
|
|
||
| build/* | ||
| !build/libs/ | ||
| !build/libs/eat-ssu.jar | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,8 @@ | ||
| # 1단계: 빌드 단계 (Gradle Wrapper를 사용하여 애플리케이션 빌드) | ||
| FROM --platform=linux/amd64 gradle:7.5.1-jdk17 AS builder | ||
| WORKDIR /home/gradle/project | ||
|
|
||
| # 소스 코드 전체를 복사 (gradlew, build.gradle, settings.gradle, src/ 등) | ||
| COPY --chown=gradle:gradle . . | ||
|
|
||
| # Gradle Wrapper 실행 권한 부여 (실행 권한이 없을 경우를 대비) | ||
| RUN chmod +x gradlew | ||
|
|
||
| # Gradle을 사용하여 프로젝트 빌드 (JAR 파일은 build/libs 폴더에 생성됨) | ||
| RUN ./gradlew clean build --no-daemon | ||
|
|
||
| # 2단계: 실행 단계 (빌드 결과물 실행을 위한 환경) | ||
| FROM --platform=linux/amd64 eclipse-temurin:17-jdk-alpine | ||
| FROM --platform=linux/amd64 eclipse-temurin:17-jre-alpine | ||
| WORKDIR /app | ||
|
|
||
| # 빌드 단계에서 생성된 JAR 파일 복사 (파일명이 프로젝트에 따라 달라질 수 있으므로 와일드카드 사용) | ||
| COPY --from=builder /home/gradle/project/build/libs/*.jar app.jar | ||
| COPY build/libs/eat-ssu.jar app.jar | ||
|
|
||
| # 컨테이너에서 사용할 포트 (필요 시 변경) | ||
| EXPOSE 9000 | ||
|
|
||
| # 애플리케이션 실행 | ||
| ENTRYPOINT ["java", "-jar", "app.jar"] | ||
|
Comment on lines
+1
to
8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재 Dockerfile은 root 권한으로 애플리케이션을 실행하도록 설정되어 있습니다. 컨테이너 내에서 root 권한으로 프로세스를 실행하는 것은 보안상 위험할 수 있으므로, 별도의 비특권(non-root) 사용자를 생성하여 실행하는 것을 권장합니다. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 설정된
*/.DS_Store패턴은 1단계 하위 디렉토리의.DS_Store파일만 제외합니다. 프로젝트 하위의 모든 디렉토리에서 재귀적으로.DS_Store파일을 제외하려면**/.DS_Store패턴을 사용하는 것이 올바릅니다.