diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 1dbda667a..f125a61d3 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -43,7 +43,7 @@ dependencyManagement { } dependencies { - runtimeOnly("org.springframework.boot:spring-boot-devtools:$springVersion") + developmentOnly("org.springframework.boot:spring-boot-devtools") implementation("org.springframework.boot:spring-boot-starter-data-jpa:$springVersion") implementation("org.springframework.boot:spring-boot-starter-data-rest:$springVersion") implementation("org.springframework.boot:spring-boot-starter-web:$springVersion") @@ -99,4 +99,19 @@ tasks.named("test") { } } +// for hot-reload: +tasks.register("getDependencies") { + from(sourceSets.main.get().runtimeClasspath) + into("runtime/") + + doFirst { + val runtimeDir = File("runtime") + runtimeDir.deleteRecursively() + runtimeDir.mkdir() + } + + doLast { + File("runtime").deleteRecursively() + } +} diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 0d304fcc7..c6f099b0f 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -35,7 +35,5 @@ sentry.proxy.port=8090 sentry.traces-sample-rate=1.0 sentry.environment=production sentry.use-git-commit-id-as-release=true -# Set traces_sample_rate to 1.0 to capture 100% -# of transactions for performance monitoring. -# We recommend adjusting this value in production. +# hot reload: spring.devtools.livereload.enabled=true diff --git a/infra/configurations/backend/application-local.properties b/infra/configurations/backend/application-local.properties index 8ae3031c2..905e873c1 100644 --- a/infra/configurations/backend/application-local.properties +++ b/infra/configurations/backend/application-local.properties @@ -5,3 +5,5 @@ sentry.enabled=false sentry.dsn= sentry.traces-sample-rate=1.0 sentry.environment=localhost +# hot reload: +spring.devtools.livereload.enabled=true diff --git a/infra/docker/app/DockerfileLocalBack b/infra/docker/app/DockerfileLocalBack index 1b1f78b13..3ee876362 100644 --- a/infra/docker/app/DockerfileLocalBack +++ b/infra/docker/app/DockerfileLocalBack @@ -33,5 +33,5 @@ COPY infra/configurations/backend ./configurations/ EXPOSE 80 # Run the backend application -CMD ./gradlew bootRun --args='--spring.profiles.active=local --spring.config.additional-location=/tmp/backend/configurations/' +CMD (./gradlew -t :bootJar) & ./gradlew bootRun -PskipDownload=true --args='--spring.profiles.active=local --spring.config.additional-location=/tmp/backend/configurations/'