Skip to content

chore: application.propertise 배포용과 개발용 분리#47

Merged
choubung merged 1 commit intodevfrom
hot-fix/ver1-1
Nov 18, 2025
Merged

chore: application.propertise 배포용과 개발용 분리#47
choubung merged 1 commit intodevfrom
hot-fix/ver1-1

Conversation

@choubung
Copy link
Copy Markdown
Owner

@choubung choubung commented Nov 18, 2025

Summary by CodeRabbit

변경 사항

  • Chores
    • 프로덕션 환경을 위한 데이터베이스 설정 구성 추가
    • 개발 환경 데이터베이스 설정 정리 및 최적화
    • 배포 환경별 애플리케이션 설정 체계 개선

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 18, 2025

전체 요약

Spring Boot 애플리케이션의 환경별 설정 구조를 재정렬했습니다. 새로운 프로덕션 프로퍼티 파일을 추가하고 기본 프로퍼티 파일의 데이터베이스 및 JPA 설정을 명시적 값으로 변경했습니다.

변경 사항

코호트 / 파일(들) 변경 요약
신규 프로덕션 구성
src/main/resources/application-prod.properties
MySQL 연결 설정(URL, 사용자명, 비밀번호, 드라이버)과 JPA/Hibernate 설정(ddl-auto=validate, show-sql=false, MySQLDialect) 추가. H2 콘솔 비활성화.
기본 프로퍼티 파일 업데이트
src/main/resources/application.properties
동적 서버 포트 제거(${PORT:9090}). 파라미터화된 데이터소스 설정을 H2 명시적 값으로 변경(URL, 드라이버, 사용자명, 비밀번호). JPA 데이터베이스 플랫폼을 H2Dialect로 추가. H2 콘솔 경로 설정 추가.

예상 코드 리뷰 노력

🎯 2 (단순) | ⏱️ ~8분

  • 두 파일 모두 Spring Boot 설정 구조로, 일관된 패턴의 프로퍼티 추가/수정
  • 논리적 복잡성 없이 명시적인 설정 값 적용
  • 환경별 프로파일 분리 구조의 명확한 의도

🐰 설정의 숲에서 길을 찾아
프로덕션과 개발이 갈라서니
MySQL과 H2가 제 자리를 잡고
환경별 무대가 펼쳐지네!
명시적인 값들이 춤을 추며
설정의 여행이 시작되었네요 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 변경 사항의 핵심을 명확하게 설명합니다. application.properties를 배포용(prod)과 개발용으로 분리한 주요 변경 사항을 정확하게 반영합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hot-fix/ver1-1

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/main/resources/application-prod.properties (1)

1-12: 배포 환경 설정의 완전성 검증

현재 기본적인 데이터베이스 및 JPA 설정이 포함되어 있습니다. 다만 배포 환경에서 권장되는 다음 설정 추가 여부를 검토하시기 바랍니다:

  • 커넥션 풀 설정(hikari)
  • 쿼리 타임아웃 설정
  • 로깅 레벨 설정
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c3f7ff and 51ae2aa.

📒 Files selected for processing (2)
  • src/main/resources/application-prod.properties (1 hunks)
  • src/main/resources/application.properties (1 hunks)
🔇 Additional comments (6)
src/main/resources/application-prod.properties (2)

1-3: 환경 변수 기본값 설정 검토 필요

현재 MySQL 데이터베이스 연결 정보(DB_URL, DB_USERNAME, DB_PASSWORD)가 환경 변수에만 의존하고 있습니다. 배포 환경에서 이 변수들이 항상 설정되어 있는지, 또는 기본값 처리 메커니즘이 있는지 확인이 필요합니다.


7-7: 배포 환경에 적절한 JPA 설정 ✓

ddl-auto=validate 설정으로 배포 환경에서는 기존 스키마만 검증하고 자동 변경을 방지하는 안전한 구성입니다. 개발 환경(application.properties의 update)과의 차이가 명확하고 적절합니다.

src/main/resources/application.properties (4)

4-8: 개발 환경 H2 설정이 적절합니다 ✓

H2 로컬 데이터베이스 설정이 개발 편의성을 위해 잘 구성되어 있습니다. AUTO_SERVER=TRUE로 설정되어 여러 애플리케이션 인스턴스가 동시에 접근 가능하도록 구성되었습니다.


10-14: 개발 환경 JPA 설정이 구성되어 있습니다 ✓

개발 환경에 적합한 설정으로 구성됨:

  • ddl-auto=update: 스키마 자동 업데이트
  • show-sql=true: SQL 쿼리 로깅
  • H2Dialect: H2 데이터베이스 방언 명시

배포 환경(application-prod.properties)의 보수적인 설정과 적절히 대비됩니다.


16-18: H2 콘솔 활성화 여부 검토 필요

현재 H2 콘솔이 비활성화(enabled=false)되어 있으면서 경로(/h2-console)가 설정되어 있습니다. 개발 환경에서 데이터베이스 검사 목적으로 H2 콘솔이 필요한 경우 다음과 같이 수정을 고려하시기 바랍니다:

-spring.h2.console.enabled=false
+spring.h2.console.enabled=true

의도적으로 개발 환경에서도 콘솔을 비활성화하신다면, 경로 설정(line 18)은 불필요합니다.


1-18: server.port 설정 제거의 의도 확인 필요

제거된 설정: server.port=${PORT:9090}

동적 포트 바인딩이 제거되어 개발 환경에서 고정 포트 방식으로 변경되었습니다. 이로 인해 포트 충돌 시 자동 우회가 불가능합니다.

기본 서버 포트가 명시되지 않으면 Spring Boot 기본값(8080)이 사용됩니다. 개발 환경에서 특정 포트 필요 여부를 확인하시기 바랍니다.

@choubung choubung merged commit cefb390 into dev Nov 18, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 18, 2025
Merged
@choubung choubung deleted the hot-fix/ver1-1 branch November 18, 2025 09:33
@choubung choubung self-assigned this Nov 19, 2025
@choubung choubung added this to the 2️⃣ 배포 milestone Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant