feat: configurable config directory

This commit is contained in:
Gauthier Roebroeck 2022-01-13 16:04:21 +08:00
parent 96dee1d70c
commit c643d55ee8
4 changed files with 14 additions and 12 deletions

View file

@ -6,10 +6,7 @@ COPY ${DEPENDENCY}/dependencies/ ./
COPY ${DEPENDENCY}/spring-boot-loader/ ./ COPY ${DEPENDENCY}/spring-boot-loader/ ./
COPY ${DEPENDENCY}/snapshot-dependencies/ ./ COPY ${DEPENDENCY}/snapshot-dependencies/ ./
COPY ${DEPENDENCY}/application/ ./ COPY ${DEPENDENCY}/application/ ./
ENV KOMGA_DATABASE_FILE="/config/database.sqlite" ENV KOMGA_CONFIGDIR="/config"
ENV KOMGA_LUCENE_DATA_DIRECTORY="/config/lucene"
ENV SPRING_ARTEMIS_EMBEDDED_DATA_DIRECTORY="/config/artemis"
ENV LOGGING_FILE_NAME="/config/logs/komga.log"
ENV LC_ALL=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"] ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"]
EXPOSE 8080 EXPOSE 8080

View file

@ -6,10 +6,7 @@ COPY ${DEPENDENCY}/dependencies/ ./
COPY ${DEPENDENCY}/spring-boot-loader/ ./ COPY ${DEPENDENCY}/spring-boot-loader/ ./
COPY ${DEPENDENCY}/snapshot-dependencies/ ./ COPY ${DEPENDENCY}/snapshot-dependencies/ ./
COPY ${DEPENDENCY}/application/ ./ COPY ${DEPENDENCY}/application/ ./
ENV KOMGA_DATABASE_FILE="/config/database.sqlite" ENV KOMGA_CONFIGDIR="/config"
ENV KOMGA_LUCENE_DATA_DIRECTORY="/config/lucene"
ENV SPRING_ARTEMIS_EMBEDDED_DATA_DIRECTORY="/config/artemis"
ENV LOGGING_FILE_NAME="/config/logs/komga.log"
ENV LC_ALL=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"] ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"]
EXPOSE 8080 EXPOSE 8080

View file

@ -44,6 +44,8 @@ class KomgaProperties {
var lucene = Lucene() var lucene = Lucene()
var configDir: String? = null
class RememberMe { class RememberMe {
@get:NotBlank @get:NotBlank
var key: String? = null var key: String? = null

View file

@ -8,7 +8,7 @@ logging:
clean-history-on-start: true clean-history-on-start: true
max-file-size: 10MB max-file-size: 10MB
file: file:
name: \${user.home}/.komga/komga.log name: \${komga.config-dir}/logs/komga.log
level: level:
org.apache.activemq.audit: WARN org.apache.activemq.audit: WARN
@ -18,10 +18,11 @@ komga:
- "#recycle" - "#recycle"
- "@eaDir" - "@eaDir"
database: database:
file: \${user.home}/.komga/database.sqlite file: \${komga.config-dir}/database.sqlite
lucene: lucene:
data-directory: \${user.home}/.komga/lucene data-directory: \${komga.config-dir}/lucene
session-timeout: 7d session-timeout: 7d
config-dir: \${user.home}/.komga
spring: spring:
flyway: flyway:
@ -39,13 +40,18 @@ spring:
artemis: artemis:
embedded: embedded:
persistent: true persistent: true
data-directory: \${user.home}/.komga/artemis data-directory: \${komga.config-dir}/artemis
web: web:
resources: resources:
add-mappings: false add-mappings: false
jackson: jackson:
deserialization: deserialization:
FAIL_ON_NULL_FOR_PRIMITIVES: true 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: server:
servlet.session.timeout: 7d servlet.session.timeout: 7d