Skip to content

Commit

Permalink
feat: Enable local development
Browse files Browse the repository at this point in the history
  • Loading branch information
beo1975 committed Nov 10, 2024
1 parent df1e2f3 commit 818ee19
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.springframework.boot.gradle.tasks.bundling.BootJar

plugins {
java
alias(libs.plugins.spring.boot)
Expand Down Expand Up @@ -31,5 +33,8 @@ dependencies {
testImplementation(libs.testcontainers.common)
testImplementation(libs.testcontainers.junit.jupiter)
testImplementation(libs.testcontainers.postgresql)
testCompileOnly(libs.spring.boot.devtools)
testRuntimeOnly(libs.junit.platform.launcher)
}

tasks.getByName<BootJar>("bootJar") { this.archiveFileName.set("dictionary-learning-platform.jar") }
12 changes: 12 additions & 0 deletions app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ spring:
virtual:
enabled: true

management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: info,health,sbom
server:
error:
whitelabel:
enabled: false
gg:
jte:
development-mode: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.dictionary.learning.platform;

import com.dictionary.learning.platform.config.ContainersConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DictionaryLearningPlatformTestApplication {

public static void main(String[] args) {
SpringApplication.from(DictionaryLearningPlatformApplication::main)
.with(ContainersConfig.class)
.run(args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.dictionary.learning.platform.config;

import org.springframework.boot.devtools.restart.RestartScope;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;

@TestConfiguration(proxyBeanMethods = false)
public class ContainersConfig {

@Bean
@ServiceConnection
@RestartScope
public PostgreSQLContainer<?> postgresSqlContainer() {
return new PostgreSQLContainer<>("postgres:16.4");
}
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spring-boot-starter-actuator = { module = "org.springframework.boot:spring-boot-
spring-boot-starter-data-jpa = { module = "org.springframework.boot:spring-boot-starter-data-jpa" }
spring-boot-starter-validation = { module = "org.springframework.boot:spring-boot-starter-validation" }
spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test" }
spring-boot-devtools = { module = "org.springframework.boot:spring-boot-devtools" }
spring-boot-testcontainers = { module = "org.springframework.boot:spring-boot-testcontainers" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
database-postgresql = { module = "org.postgresql:postgresql" }
Expand Down

0 comments on commit 818ee19

Please sign in to comment.