diff --git a/komga/Dockerfile b/komga/Dockerfile index f64ee83fd..ed50f37ad 100644 --- a/komga/Dockerfile +++ b/komga/Dockerfile @@ -6,10 +6,7 @@ COPY ${DEPENDENCY}/dependencies/ ./ COPY ${DEPENDENCY}/spring-boot-loader/ ./ COPY ${DEPENDENCY}/snapshot-dependencies/ ./ COPY ${DEPENDENCY}/application/ ./ -ENV KOMGA_DATABASE_FILE="/config/database.sqlite" -ENV KOMGA_LUCENE_DATA_DIRECTORY="/config/lucene" -ENV SPRING_ARTEMIS_EMBEDDED_DATA_DIRECTORY="/config/artemis" -ENV LOGGING_FILE_NAME="/config/logs/komga.log" +ENV KOMGA_CONFIGDIR="/config" ENV LC_ALL=en_US.UTF-8 ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"] EXPOSE 8080 diff --git a/komga/Dockerfile.legacy b/komga/Dockerfile.legacy index 28299fcfd..c0b5c0570 100644 --- a/komga/Dockerfile.legacy +++ b/komga/Dockerfile.legacy @@ -6,10 +6,7 @@ COPY ${DEPENDENCY}/dependencies/ ./ COPY ${DEPENDENCY}/spring-boot-loader/ ./ COPY ${DEPENDENCY}/snapshot-dependencies/ ./ COPY ${DEPENDENCY}/application/ ./ -ENV KOMGA_DATABASE_FILE="/config/database.sqlite" -ENV KOMGA_LUCENE_DATA_DIRECTORY="/config/lucene" -ENV SPRING_ARTEMIS_EMBEDDED_DATA_DIRECTORY="/config/artemis" -ENV LOGGING_FILE_NAME="/config/logs/komga.log" +ENV KOMGA_CONFIGDIR="/config" ENV LC_ALL=en_US.UTF-8 ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"] EXPOSE 8080 diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/configuration/KomgaProperties.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/configuration/KomgaProperties.kt index fd877bad6..a3e9193c7 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/configuration/KomgaProperties.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/configuration/KomgaProperties.kt @@ -44,6 +44,8 @@ class KomgaProperties { var lucene = Lucene() + var configDir: String? = null + class RememberMe { @get:NotBlank var key: String? = null diff --git a/komga/src/main/resources/application.yml b/komga/src/main/resources/application.yml index b5861ab92..d389de0ea 100644 --- a/komga/src/main/resources/application.yml +++ b/komga/src/main/resources/application.yml @@ -8,7 +8,7 @@ logging: clean-history-on-start: true max-file-size: 10MB file: - name: \${user.home}/.komga/komga.log + name: \${komga.config-dir}/logs/komga.log level: org.apache.activemq.audit: WARN @@ -18,10 +18,11 @@ komga: - "#recycle" - "@eaDir" database: - file: \${user.home}/.komga/database.sqlite + file: \${komga.config-dir}/database.sqlite lucene: - data-directory: \${user.home}/.komga/lucene + data-directory: \${komga.config-dir}/lucene session-timeout: 7d + config-dir: \${user.home}/.komga spring: flyway: @@ -39,13 +40,18 @@ spring: artemis: embedded: persistent: true - data-directory: \${user.home}/.komga/artemis + data-directory: \${komga.config-dir}/artemis web: resources: add-mappings: false jackson: deserialization: FAIL_ON_NULL_FOR_PRIMITIVES: true + config: + import: + - "optional:file:\${komga.config-dir}/application.yml" + - "optional:file:\${komga.config-dir}/application.yaml" + - "optional:file:\${komga.config-dir}/application.properties" server: servlet.session.timeout: 7d