Skip to content

Commit

Permalink
#36 - 헤로쿠 설정을 추가
Browse files Browse the repository at this point in the history
헤로쿠에 연동하기 위한 설정들을 가이드에 따라 넣고
헤로쿠에서 동작할 전용 스프링 부트 프로파일을 설정함.
  • Loading branch information
djkeh committed Aug 7, 2024
1 parent 16fed73 commit 9c3395f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: java $JAVA_OPTS -Dserver.port=$PORT -Dspring.profiles.active=heroku -jar build/libs/test-data-v1.0.jar
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'uno.fastcampus'
version = '0.0.1-SNAPSHOT'
version = 'v1.0'

java {
toolchain {
Expand Down Expand Up @@ -44,3 +44,10 @@ tasks.named('test') {
useJUnitPlatform()
jvmArgs('-Xshare:off', '-XX:+EnableDynamicAgentLoading')
}

// Heroku 설정
jar {
manifest {
attributes('Main-Class': 'uno.fastcampus.testdata.TestDataApplication')
}
}
11 changes: 11 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,14 @@ spring:
spring:
config.activate.on-profile: test
datasource.url: jdbc:h2:mem:testdb;MODE=MySQL;DATABASE_TO_LOWER=TRUE

---

spring:
config.activate.on-profile: heroku
datasource:
url: ${JAWSDB_URL}
jpa:
hibernate.ddl-auto: create
defer-datasource-initialization: true
sql.init.mode: always
1 change: 1 addition & 0 deletions system.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java.runtime.version=21

0 comments on commit 9c3395f

Please sign in to comment.