-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#7 #18
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
Feat/#7 #18
Changes from 20 commits
51a7ff4
2d12b11
44486c9
9ba35f5
f6b4721
2deb263
d4c38eb
ce812e4
41ae93d
3667def
f17b055
aac77eb
c427ed1
a426592
e683508
7670b92
febdc20
44ac306
b5f663d
08211f7
1d101ad
7cb12fe
5cc5655
a732f84
85caa33
74b7f72
5c47ead
a0a498f
36f57ad
4229c2a
50dfc34
2d7e099
b385dbb
c98470b
41c0886
76224ac
552cf64
3547cb7
5203d51
3bf18d0
2fc6be2
02d31cc
feb2d32
f077349
20935dd
a6fbf29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Git | ||
| .git | ||
| .gitignore | ||
| .gitattributes | ||
| .github | ||
|
|
||
| # Gradle | ||
| .gradle | ||
| build/ | ||
| !gradle/wrapper/gradle-wrapper.jar | ||
| !gradle/wrapper/gradle-wrapper.properties | ||
|
|
||
| # IDE | ||
| .idea | ||
| *.iml | ||
| *.iws | ||
| *.ipr | ||
| .vscode | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| *.log | ||
|
|
||
| # Local data | ||
| postgres_data/ | ||
| localstack_data/ | ||
|
|
||
| # Docker | ||
| Dockerfile | ||
| .dockerignore | ||
| docker-compose.yaml | ||
|
|
||
| # Documentation | ||
| README.md | ||
| *.md | ||
|
|
||
| # Kotlin | ||
| .kotlin | ||
|
|
||
| # Test | ||
| src/test/ | ||
|
|
||
| # Misc | ||
| Makefile |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Build stage | ||
| FROM eclipse-temurin:21-jdk-alpine AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Gradle wrapper와 설정 파일 복사 (캐싱 최적화를 위해 먼저 복사) | ||
| COPY gradle gradle | ||
| COPY gradlew . | ||
| COPY settings.gradle.kts . | ||
| COPY build.gradle.kts . | ||
|
|
||
| # 실행 권한 부여 | ||
| RUN chmod +x ./gradlew | ||
|
|
||
| # 의존성 다운로드 (소스 코드 변경 시에도 이 레이어는 캐시됨) | ||
| RUN ./gradlew dependencies --no-daemon | ||
|
|
||
| # 소스 코드 복사 | ||
| COPY src src | ||
|
|
||
| # 애플리케이션 빌드 | ||
| RUN ./gradlew bootJar --no-daemon -x test | ||
|
|
||
| # Runtime stage | ||
| FROM eclipse-temurin:21-jre-alpine | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # 보안을 위해 non-root 사용자 생성 | ||
| RUN addgroup -S spring && adduser -S spring -G spring | ||
| USER spring:spring | ||
|
|
||
| # 빌드된 JAR 파일 복사 | ||
| COPY --from=builder /app/build/libs/*.jar app.jar | ||
|
|
||
| # 환경변수 설정 (기본값, 런타임에 오버라이드 가능) | ||
| ENV SPRING_PROFILES_ACTIVE=staging | ||
| ENV JASYPT_PASSWORD="" | ||
|
|
||
| # 애플리케이션 실행 | ||
| # Spring Boot가 SPRING_PROFILES_ACTIVE, JASYPT_PASSWORD 환경변수를 자동으로 읽음 | ||
| ENTRYPOINT ["java", "-jar", "app.jar"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.yapp2app.auth.api.request | ||
|
|
||
| import jakarta.validation.constraints.NotBlank | ||
|
|
||
| /** | ||
| * fileName : AuthRequest | ||
| * author : darren | ||
| * date : 2025. 12. 26. 18:05 | ||
| * description : 인증/인가 관련 요청 body | ||
| */ | ||
| data class KakaoOIDCLoginRequest(@NotBlank(message = "ID 토큰은 필수입니다") val idToken: String) | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.yapp2app.auth.api.response | ||
|
|
||
| import com.yapp2app.user.domain.enums.ProviderType | ||
|
|
||
| /** | ||
| * fileName : AuthResponse | ||
| * author : darren | ||
| * date : 2025. 12. 26. 18:05 | ||
| * description : Auth aggregate에 대한 응답 | ||
| */ | ||
| data class GetKakaoRegisterResponse(val oid: Long, val providerType: ProviderType) | ||
|
|
||
| data class GetKakaoTokenResponse( | ||
| val accessToken: String, | ||
| val tokenType: String, | ||
| val refreshToken: String, | ||
| val expiresIn: Int, | ||
| val scope: String? = null, | ||
| val refreshTokenExpiresIn: Int? = null, | ||
| val idToken: String? = null, | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.yapp2app.auth.application.command | ||
|
|
||
| /** | ||
| * fileName : AuthCommand | ||
| * author : darren | ||
| * date : 2025. 12. 12. 13:18 | ||
| * description : 인증/인가 관련 API | ||
| */ | ||
| data class RegisterKakaoUserCommand(val idToken: String) |
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.
DockerFile 내부에서 gradle build를 하는 것 같은데, multi stage build가 필요하지 않다면 외부에서 gradle build를 하고 빌드 결과물만 COPY해오는 방법이 어떨까요? 트레이드 오프가 있을 것 같은데, DockerFile 내부에서 gradle build를 하면 캐싱을 사실상 활용하기가 어려워 전체 빌드 시간이 증가하고 gradle build에만 필요한 파일들이 포함되어 이미지 크기가 증가할 것 같습니다.
reference:
https://www.linkedin.com/posts/sabaribalajip_should-i-build-my-jar-externally-and-copy-activity-7364497498779947009-GkIG
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.
말씀하신대로 GitAction 시점에 build한 jar를 이용하는 방식으로 진행했으며 Layerd Cache를 이용하여 이미지를 만들도록 변경했습니다!