mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 21:00:16 +02:00
build: migration to Spring Boot 2.3.2
This commit is contained in:
parent
792cab94bf
commit
e824bef126
5 changed files with 34 additions and 26 deletions
|
|
@ -1,13 +1,14 @@
|
|||
FROM adoptopenjdk:11-jre-hotspot
|
||||
VOLUME /tmp
|
||||
ARG DEPENDENCY=build/dependency
|
||||
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
|
||||
COPY ${DEPENDENCY}/META-INF /app/META-INF
|
||||
COPY ${DEPENDENCY}/BOOT-INF/classes /app
|
||||
COPY ${DEPENDENCY}/dependencies/ /app/
|
||||
COPY ${DEPENDENCY}/spring-boot-loader/ /app/
|
||||
COPY ${DEPENDENCY}/snapshot-dependencies/ /app/
|
||||
COPY ${DEPENDENCY}/application/ /app/
|
||||
ENV KOMGA_DATABASE_BACKUP_PATH="/config/database-backup.zip"
|
||||
ENV KOMGA_DATABASE_FILE="/config/database.sqlite"
|
||||
ENV SPRING_DATASOURCE_URL="jdbc:h2:/config/database.h2"
|
||||
ENV SPRING_ARTEMIS_EMBEDDED_DATA_DIRECTORY="/config/artemis"
|
||||
ENV LOGGING_FILE_NAME="/config/logs/komga.log"
|
||||
ENTRYPOINT ["java","-cp","app:app/lib/*","org.gotson.komga.ApplicationKt"]
|
||||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
|
||||
EXPOSE 8080
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.rohanprabhu.gradle.plugins.kdjooq.jooqCodegenConfiguration
|
|||
import com.rohanprabhu.gradle.plugins.kdjooq.target
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
|
||||
plugins {
|
||||
|
|
@ -15,11 +16,11 @@ plugins {
|
|||
kotlin("plugin.spring") version kotlinVersion
|
||||
kotlin("kapt") version kotlinVersion
|
||||
}
|
||||
id("org.springframework.boot") version "2.2.6.RELEASE"
|
||||
id("org.springframework.boot") version "2.3.2.RELEASE"
|
||||
id("com.github.ben-manes.versions") version "0.28.0"
|
||||
id("com.gorylenko.gradle-git-properties") version "2.2.2"
|
||||
id("com.rohanprabhu.kotlin-dsl-jooq") version "0.4.5"
|
||||
id("org.flywaydb.flyway") version "6.4.0"
|
||||
id("org.flywaydb.flyway") version "6.4.4"
|
||||
id("com.github.johnrengelman.processes") version "0.5.0"
|
||||
id("org.springdoc.openapi-gradle-plugin") version "1.3.0"
|
||||
jacoco
|
||||
|
|
@ -27,9 +28,6 @@ plugins {
|
|||
|
||||
group = "org.gotson"
|
||||
|
||||
val developmentOnly = configurations.create("developmentOnly")
|
||||
configurations.runtimeClasspath.get().extendsFrom(developmentOnly)
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
|
|
@ -39,15 +37,10 @@ dependencies {
|
|||
implementation(kotlin("stdlib-jdk8"))
|
||||
implementation(kotlin("reflect"))
|
||||
|
||||
constraints {
|
||||
implementation("org.flywaydb:flyway-core:6.4.0") {
|
||||
because("support for H2 1.4.200 requires 6.1.0+")
|
||||
}
|
||||
}
|
||||
|
||||
implementation(platform("org.springframework.boot:spring-boot-dependencies:2.2.6.RELEASE"))
|
||||
implementation(platform("org.springframework.boot:spring-boot-dependencies:2.3.2.RELEASE"))
|
||||
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
|
||||
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
||||
implementation("org.springframework.boot:spring-boot-starter-security")
|
||||
|
|
@ -55,7 +48,7 @@ dependencies {
|
|||
implementation("org.springframework.boot:spring-boot-starter-artemis")
|
||||
implementation("org.springframework.boot:spring-boot-starter-jooq")
|
||||
|
||||
kapt("org.springframework.boot:spring-boot-configuration-processor:2.2.6.RELEASE")
|
||||
kapt("org.springframework.boot:spring-boot-configuration-processor:2.3.2.RELEASE")
|
||||
|
||||
implementation("org.apache.activemq:artemis-jms-server")
|
||||
|
||||
|
|
@ -63,7 +56,7 @@ dependencies {
|
|||
|
||||
implementation("io.github.microutils:kotlin-logging:1.7.9")
|
||||
implementation("io.micrometer:micrometer-registry-influx")
|
||||
implementation("io.hawt:hawtio-springboot:2.10.0")
|
||||
implementation("io.hawt:hawtio-springboot:2.10.1")
|
||||
|
||||
run {
|
||||
val springdocVersion = "1.3.4"
|
||||
|
|
@ -110,7 +103,7 @@ dependencies {
|
|||
|
||||
testImplementation("com.tngtech.archunit:archunit-junit5:0.13.1")
|
||||
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools:2.3.2.RELEASE")
|
||||
}
|
||||
|
||||
val webui = "$rootDir/komga-webui"
|
||||
|
|
@ -122,6 +115,10 @@ tasks {
|
|||
}
|
||||
}
|
||||
|
||||
withType<BootJar> {
|
||||
layered()
|
||||
}
|
||||
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
systemProperty("spring.profiles.active", "test")
|
||||
|
|
@ -134,10 +131,14 @@ tasks {
|
|||
}
|
||||
|
||||
//unpack Spring Boot's fat jar for better Docker image layering
|
||||
register<Sync>("unpack") {
|
||||
register<JavaExec>("unpack") {
|
||||
dependsOn(bootJar)
|
||||
from(zipTree(getByName("bootJar").outputs.files.singleFile))
|
||||
into("$buildDir/dependency")
|
||||
classpath = files(jar)
|
||||
jvmArgs = listOf("-Djarmode=layertools")
|
||||
args = "extract --destination $buildDir/dependency".split(" ")
|
||||
doFirst {
|
||||
delete("$buildDir/dependency")
|
||||
}
|
||||
}
|
||||
|
||||
register<Exec>("npmInstall") {
|
||||
|
|
|
|||
|
|
@ -8,12 +8,16 @@ import org.springframework.boot.jdbc.DataSourceBuilder
|
|||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.context.annotation.Primary
|
||||
import org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
|
||||
import org.springframework.data.relational.core.dialect.Dialect
|
||||
import org.springframework.data.relational.core.dialect.H2Dialect
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
|
||||
import javax.sql.DataSource
|
||||
|
||||
@Configuration
|
||||
class DataSourcesConfiguration(
|
||||
private val komgaProperties: KomgaProperties
|
||||
) {
|
||||
) : AbstractJdbcConfiguration() {
|
||||
|
||||
@Bean("sqliteDataSource")
|
||||
@Primary
|
||||
|
|
@ -35,4 +39,6 @@ class DataSourcesConfiguration(
|
|||
fun h2DataSource(): DataSource =
|
||||
h2DataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource::class.java).build()
|
||||
|
||||
@Bean
|
||||
override fun jdbcDialect(operations: NamedParameterJdbcOperations): Dialect = H2Dialect.INSTANCE
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package org.gotson.komga.infrastructure.jms
|
||||
|
||||
import org.apache.activemq.artemis.api.core.QueueConfiguration
|
||||
import org.apache.activemq.artemis.api.core.RoutingType
|
||||
import org.apache.activemq.artemis.core.config.CoreQueueConfiguration
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings
|
||||
import org.springframework.boot.autoconfigure.jms.artemis.ArtemisConfigurationCustomizer
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
|
@ -24,9 +24,8 @@ class ArtemisConfig : ArtemisConfigurationCustomizer {
|
|||
defaultConsumerWindowSize = 0
|
||||
})
|
||||
it.addQueueConfiguration(
|
||||
CoreQueueConfiguration()
|
||||
QueueConfiguration(QUEUE_TASKS)
|
||||
.setAddress(QUEUE_TASKS)
|
||||
.setName(QUEUE_TASKS)
|
||||
.setLastValueKey(QUEUE_UNIQUE_ID)
|
||||
.setRoutingType(RoutingType.ANYCAST)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ spring:
|
|||
server:
|
||||
servlet.session.timeout: 7d
|
||||
forward-headers-strategy: framework
|
||||
shutdown: graceful
|
||||
|
||||
management:
|
||||
endpoints.web.exposure.include: "*"
|
||||
|
|
|
|||
Loading…
Reference in a new issue