store update
This commit is contained in:
+50
-50
@@ -1,51 +1,51 @@
|
||||
# Analytics 서비스용 Dockerfile
|
||||
FROM eclipse-temurin:21-jdk-alpine AS builder
|
||||
|
||||
# 작업 디렉토리 설정
|
||||
WORKDIR /app
|
||||
|
||||
# Gradle Wrapper와 설정 파일 복사
|
||||
COPY gradlew .
|
||||
COPY gradle/wrapper gradle/wrapper
|
||||
COPY build.gradle .
|
||||
COPY settings.gradle .
|
||||
|
||||
# 소스 코드 복사
|
||||
COPY common common/
|
||||
COPY analytics analytics/
|
||||
|
||||
# 실행 권한 부여 및 빌드
|
||||
RUN chmod +x ./gradlew
|
||||
RUN ./gradlew analytics:build -x test --no-daemon
|
||||
|
||||
# 실행 단계
|
||||
FROM eclipse-temurin:21-jre-alpine
|
||||
|
||||
# 애플리케이션 사용자 생성
|
||||
RUN addgroup -g 1001 -S appgroup && \
|
||||
adduser -u 1001 -S appuser -G appgroup
|
||||
|
||||
# 작업 디렉토리 설정
|
||||
WORKDIR /app
|
||||
|
||||
# 빌드된 JAR 파일 복사
|
||||
COPY --from=builder /app/analytics/build/libs/analytics-*.jar app.jar
|
||||
|
||||
# 파일 소유권 변경
|
||||
RUN chown -R appuser:appgroup /app
|
||||
|
||||
# 사용자 변경
|
||||
USER appuser
|
||||
|
||||
# 포트 노출
|
||||
EXPOSE 8080
|
||||
|
||||
# 헬스체크 추가
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
|
||||
|
||||
# JVM 옵션 설정
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication"
|
||||
|
||||
# 애플리케이션 실행
|
||||
# Analytics 서비스용 Dockerfile
|
||||
FROM eclipse-temurin:21-jdk-alpine AS builder
|
||||
|
||||
# 작업 디렉토리 설정
|
||||
WORKDIR /app
|
||||
|
||||
# Gradle Wrapper와 설정 파일 복사
|
||||
COPY gradlew .
|
||||
COPY gradle/wrapper gradle/wrapper
|
||||
COPY build.gradle .
|
||||
COPY settings.gradle .
|
||||
|
||||
# 소스 코드 복사
|
||||
COPY common common/
|
||||
COPY analytics analytics/
|
||||
|
||||
# 실행 권한 부여 및 빌드
|
||||
RUN chmod +x ./gradlew
|
||||
RUN ./gradlew analytics:build -x test --no-daemon
|
||||
|
||||
# 실행 단계
|
||||
FROM eclipse-temurin:21-jre-alpine
|
||||
|
||||
# 애플리케이션 사용자 생성
|
||||
RUN addgroup -g 1001 -S appgroup && \
|
||||
adduser -u 1001 -S appuser -G appgroup
|
||||
|
||||
# 작업 디렉토리 설정
|
||||
WORKDIR /app
|
||||
|
||||
# 빌드된 JAR 파일 복사
|
||||
COPY --from=builder /app/analytics/build/libs/analytics-*.jar app.jar
|
||||
|
||||
# 파일 소유권 변경
|
||||
RUN chown -R appuser:appgroup /app
|
||||
|
||||
# 사용자 변경
|
||||
USER appuser
|
||||
|
||||
# 포트 노출
|
||||
EXPOSE 8080
|
||||
|
||||
# 헬스체크 추가
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
|
||||
|
||||
# JVM 옵션 설정
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication"
|
||||
|
||||
# 애플리케이션 실행
|
||||
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ktds.hi.analytics.infra.config;
|
||||
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
@@ -9,7 +10,15 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
* JPA Auditing 및 Repository 스캔 설정
|
||||
*/
|
||||
@Configuration
|
||||
@EnableJpaAuditing
|
||||
@EnableJpaRepositories(basePackages = "com.ktds.hi.analytics.infra.gateway.repository")
|
||||
@EnableJpaRepositories(basePackages = {
|
||||
// "com.ktds.hi.store.infra.gateway.entity",
|
||||
"com.ktds.hi.common.repository"
|
||||
})
|
||||
@EntityScan(basePackages = {
|
||||
"com.ktds.hi.store.infra.gateway.entity",
|
||||
"com.ktds.hi.common.entity",
|
||||
"com.ktds.hi.common.audit"
|
||||
})
|
||||
@EnableJpaAuditing(auditorAwareRef = "customAuditorAware")
|
||||
public class JpaConfig {
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
// import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
Reference in New Issue
Block a user