mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2025-12-06 16:16:23 +00:00
- 5개 백엔드 서비스의 bootJar 설정 추가/수정 - 공통 Dockerfile-backend 생성 (멀티 스테이지 빌드) - 각 서비스별 컨테이너 이미지 빌드 완료 - 보안 강화된 컨테이너 구성 (비루트 사용자) - 상세한 빌드 결과 문서 작성 서비스 목록: - api-gateway:latest (329MB) - user-service:latest (376MB) - bill-service:latest (385MB) - product-service:latest (392MB) - kos-mock:latest (372MB)
95 lines
3.0 KiB
Groovy
95 lines
3.0 KiB
Groovy
// API Gateway 모듈
|
|
// 루트 build.gradle의 subprojects 블록에서 공통 설정 적용됨
|
|
// API Gateway는 WebFlux를 사용하므로 일부 다른 설정 필요
|
|
|
|
// Spring Cloud 버전 정의
|
|
ext {
|
|
set('springCloudVersion', '2023.0.0')
|
|
}
|
|
|
|
dependencies {
|
|
// Common module dependency (exclude WebMVC, Security, and non-reactive Redis for WebFlux)
|
|
implementation(project(':common')) {
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-web'
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-security'
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-jpa'
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-redis'
|
|
}
|
|
|
|
// Spring Cloud Gateway (api-gateway specific)
|
|
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
|
|
|
|
// Redis for health checks and caching
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
|
|
|
|
// Circuit Breaker (api-gateway specific)
|
|
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
|
|
|
|
// Monitoring (api-gateway specific)
|
|
implementation 'io.micrometer:micrometer-registry-prometheus'
|
|
|
|
// Logging (api-gateway specific)
|
|
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
|
|
|
|
// Netty macOS DNS resolver (api-gateway specific)
|
|
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.100.Final:osx-aarch_64'
|
|
|
|
// Test Dependencies (api-gateway specific)
|
|
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
|
|
}
|
|
|
|
dependencyManagement {
|
|
imports {
|
|
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
|
|
}
|
|
}
|
|
|
|
// 추가 테스트 설정 (루트에서 기본 설정됨)
|
|
tasks.named('test') {
|
|
systemProperty 'spring.profiles.active', 'test'
|
|
}
|
|
|
|
// JAR 파일명 설정
|
|
jar {
|
|
archiveBaseName = 'api-gateway'
|
|
enabled = false
|
|
}
|
|
|
|
bootJar {
|
|
archiveFileName = 'api-gateway.jar'
|
|
|
|
// 빌드 정보 추가
|
|
manifest {
|
|
attributes(
|
|
'Implementation-Title': 'PhoneBill API Gateway',
|
|
'Implementation-Version': "${version}",
|
|
'Built-By': System.getProperty('user.name'),
|
|
'Built-JDK': System.getProperty('java.version'),
|
|
'Build-Time': new Date().format('yyyy-MM-dd HH:mm:ss')
|
|
)
|
|
}
|
|
}
|
|
|
|
// 개발 환경 실행 설정
|
|
if (project.hasProperty('dev')) {
|
|
bootRun {
|
|
systemProperty 'spring.profiles.active', 'dev'
|
|
jvmArgs = ['-Dspring.devtools.restart.enabled=true']
|
|
}
|
|
}
|
|
|
|
// 프로덕션 환경 실행 설정
|
|
if (project.hasProperty('prod')) {
|
|
bootRun {
|
|
systemProperty 'spring.profiles.active', 'prod'
|
|
jvmArgs = [
|
|
'-server',
|
|
'-Xms512m',
|
|
'-Xmx1024m',
|
|
'-XX:+UseG1GC',
|
|
'-XX:G1HeapRegionSize=16m',
|
|
'-XX:+UseStringDeduplication',
|
|
'-XX:+OptimizeStringConcat'
|
|
]
|
|
}
|
|
} |