서비스를 운영할 때 로컬환경과 실제 운영환경의 세팅이 다르고 그 세팅을 바꾸는게 번거롭게 느껴져서 Spring Profile 설정에 대해 알아봤다..
보통 기본적으로 다른건 아마 DB환경일 것이다. 어떠한 특정 설정값을 다르게 하고싶을 때 사용한다. 그래서 기본적으로 배포환경이나 테스트 환경, 등 환경 세팅 값이 다를 때 사용한다.
application.yml
spring:
profiles:
active: local
#local
---
server:
port: 8080
~
spring:
profiles: local
---
#dev
server:
port:8080
~
spring:
profiles: dev
---
#prod
server:
port: 8080
~
spring:
profiles: prod
이런 식으로 환경을 분리를 해주면 된다.