Skip to content

Commit d5cc17c

Browse files
authored
배포를 위한 main 코드 최신화
배포를 위한 main 코드 최신화
2 parents 77d1579 + 9d72186 commit d5cc17c

7 files changed

Lines changed: 43 additions & 8 deletions

File tree

.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Git / IDE
2+
.git
3+
.gitignore
4+
.gitattributes
5+
.idea
6+
*.iml
7+
8+
# Gradle 캐시
9+
.gradle
10+
**/target
11+
**/out
12+
13+
# 빌드 결과물
14+
build
15+
target
16+
17+
# 로그 / 임시 파일
18+
*.log
19+
tmp

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# 1) Build stage
2+
FROM gradle:8.6-jdk17 AS builder
3+
WORKDIR /app
4+
COPY . .
5+
RUN gradle clean bootJar --no-daemon
6+
7+
# 2) Runtime stage
8+
FROM eclipse-temurin:17-jre
9+
WORKDIR /app
10+
ENV TZ=Asia/Seoul \
11+
JAVA_OPTS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0"
12+
COPY --from=builder /app/build/libs/*.jar app.jar
13+
EXPOSE 8080
14+
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /app/app.jar"]

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ dependencies {
4343
implementation 'org.springframework.retry:spring-retry:1.3.4'
4444
implementation 'org.springframework.boot:spring-boot-starter-aop'
4545
implementation 'org.springframework.boot:spring-boot-configuration-processor'
46+
implementation("org.springframework.boot:spring-boot-starter-actuator")
4647
}
4748

4849
tasks.named('test') {

src/main/java/org/example/sansam/notification/service/EmailService.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public void sendWelcomeEmail(User user) {
3232
try {
3333
MimeMessage message = createWelcomeMessage(user);
3434
if (user.getEmailAgree())javaMailSender.send(message);
35-
log.info("회원 가입 이메일 전송 완료 - {}", user.getEmail());
3635
} catch (MessagingException | jakarta.mail.MessagingException e) {
3736
log.error("회원 가입 이메일 전송 실패 - {}", user.getEmail());
3837
throw new RuntimeException(e);
@@ -67,7 +66,6 @@ public void sendPaymentCompletedEmail(User user, String orderName, Long finalPri
6766
try {
6867
MimeMessage message = createPaymentCompletedMessage(user, orderName, finalPrice);
6968
if (user.getEmailAgree()) javaMailSender.send(message);
70-
log.info("결제 완료 이메일 전송 완료 - {}", user.getEmail());
7169
} catch (Exception e) {
7270
log.error("결제 완료 이메일 전송 실패 - {}", user.getEmail());
7371
throw new RuntimeException(e);
@@ -104,7 +102,6 @@ public void sendPaymentCanceledMessage(User user, String orderName, Long refundP
104102
try {
105103
MimeMessage message = createPaymentCanceledMessage(user, orderName, refundPrice);
106104
if (user.getEmailAgree())javaMailSender.send(message);
107-
log.info("결제 취소 완료 이메일 전송 완료 - {}", user.getEmail());
108105
} catch (Exception e) {
109106
log.error("결제 취소 완료 이메일 전송 실패 - {}", user.getEmail());
110107
throw new RuntimeException(e);

src/main/java/org/example/sansam/notification/service/NotificationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private void sendNotification(User user, NotificationType type, String titlePara
144144

145145
NotificationHistories saved = saveNotificationHistory(user, template, title, message);
146146
String payload = serializeToJson(NotificationDTO.from(saved));
147-
log.info(payload);
147+
log.info(type.getEventName());
148148
sendViaSSEAsync(user.getId(), payload, type.getEventName());
149149
}
150150

src/main/resources/application.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ server:
66
session:
77
timeout: 120m
88
cookie:
9-
name: JSESSIONID
10-
http-only: true
11-
secure: false
9+
name: JSESSIONID # 쿠키 이름
10+
http-only: true # JS에서 접근 불가
11+
secure: false # https에서만 필요 시 true
1212
same-site: none
1313

1414
spring:
@@ -58,6 +58,10 @@ management:
5858
metrics:
5959
tags:
6060
application: ${spring.application.name}
61+
endpoint:
62+
health:
63+
probes:
64+
enabled: true
6165

6266
cloud:
6367
aws:

0 commit comments

Comments
 (0)