Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
FROM openjdk:17
FROM openjdk:17-slim

# 작업 디렉토리 설정
WORKDIR /app

# PEM 인증서를 시스템 CA 위치에 복사 (확장자 꼭 .crt여야 함)
COPY src/main/resources/certs/rds-combined-ca-bundle.pem /usr/local/share/ca-certificates/rds-combined-ca-bundle.crt

# 시스템 CA 목록 갱신 (PEM → 시스템 신뢰 CA로 등록)
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates

# JAR 복사
COPY build/libs/app.jar app.jar

# 앱 실행
ENTRYPOINT ["java", "-jar", "app.jar"]
19 changes: 18 additions & 1 deletion src/main/java/com/goteego/global/security/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,30 @@ public SecurityFilterChain apiSecurityFilterChain(HttpSecurity http) throws Exce
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOriginPatterns(frontendProperties.getCors().getAllowedOriginPatterns());
configuration.setAllowedOrigins(List.of(
"https://www.goteego.store",
"https://dev.goteego.store"
));
configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(List.of("Authorization", "Content-Type"));
configuration.setAllowCredentials(true);
configuration.setMaxAge(3600L);

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
}

// @Bean
// public CorsConfigurationSource corsConfigurationSource() {
// CorsConfiguration configuration = new CorsConfiguration();
// configuration.setAllowedOriginPatterns(frontendProperties.getCors().getAllowedOriginPatterns());
// configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
// configuration.setAllowedHeaders(List.of("Authorization", "Content-Type"));
// configuration.setAllowCredentials(true);
// configuration.setMaxAge(3600L);
// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
// source.registerCorsConfiguration("/**", configuration);
// return source;
// }
}
4 changes: 3 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spring:
client-name: default
password: ${REDIS_PASSWORD:}
timeout: 2000
ssl:
enabled: false
lettuce:
pool:
max-active: 8
Expand All @@ -77,7 +79,7 @@ spring:
# ✅ MongoDB 설정
########################################
mongodb:
uri: "mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST:localhost}:${MONGO_PORT:27017}/${MONGO_DATABASE}?tls=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false&authSource=${MONGO_AUTH_DB:admin}"
uri: "mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}/${MONGO_DATABASE}?tls=true&tlsAllowInvalidHostnames=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false&authSource=${MONGO_AUTH_DB:admin}"

########################################
# ✅ Devtools 설정
Expand Down
Loading
Loading