티스토리 뷰

java -jar 이런걸로 실행시키면 문제될게 없지만

gradle의 bootRun task를 사용할때 스프링 프로파일 적용 방법입니다

build.gradle에 아래와 같이 설정 추가하면 됩니다.


build.gradle

bootRun {
String activeProfile = System.properties['spring.profiles.active']
systemProperty "spring.profiles.active", activeProfile
}



Dockerfile

ENTRYPOINT ["./gradlew"]
CMD ["bootRun", "-Dspring.profiles.active=prod"]


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함