From f851f0d3152db36aca3681376d18e370cbde298d Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 27 Aug 2019 13:57:37 +0800 Subject: [PATCH 1/2] simplify docker configuration --- README.md | 2 +- doc/docker-compose.yml | 4 ---- komga/Dockerfile | 1 + komga/src/main/resources/application-docker.yml | 8 ++++++++ 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 komga/src/main/resources/application-docker.yml diff --git a/README.md b/README.md index 6cf0a4c5..27112c57 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Each configuration key can have a different format depending if it's from the en ### Mandatory configuration -In order to make Komga run, you need to specify some mandatory configuration keys: +In order to make Komga run, you need to specify some mandatory configuration keys (unless you use Docker, in which case defaults are setup): - `SPRING_PROFILES_ACTIVE` / `spring.profiles.active`: `prod` - this will enable the database management and upgrades for new versions. - `SPRING_DATASOURCE_URL` / `spring.datasource.url`: the path of the database file. For Docker I use `jdbc:h2:/config/database.h2;DB_CLOSE_DELAY=-1`, where `/config/database.h2` is the actual file inside the docker container. You can customize this part if running without docker. diff --git a/doc/docker-compose.yml b/doc/docker-compose.yml index 059eced3..374ebfe1 100644 --- a/doc/docker-compose.yml +++ b/doc/docker-compose.yml @@ -11,10 +11,6 @@ services: ports: - 8090:8080 environment: - - SPRING_PROFILES_ACTIVE=prod - - SPRING_DATASOURCE_URL=jdbc:h2:/config/database.h2;DB_CLOSE_DELAY=-1 - - KOMGA_ROOT_FOLDER=/books - - KOMGA_ROOT_FOLDER_SCAN_CRON=0 0 * * * ? # periodic scan every hour - KOMGA_USER_PASSWORD=your-admin-password - KOMGA_ADMIN_PASSWORD=your-user-password restart: unless-stopped diff --git a/komga/Dockerfile b/komga/Dockerfile index 6d650541..37b19858 100644 --- a/komga/Dockerfile +++ b/komga/Dockerfile @@ -4,4 +4,5 @@ ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app +ENV SPRING_PROFILES_ACTIVE=docker ENTRYPOINT ["java","-cp","app:app/lib/*","org.gotson.komga.ApplicationKt"] \ No newline at end of file diff --git a/komga/src/main/resources/application-docker.yml b/komga/src/main/resources/application-docker.yml new file mode 100644 index 00000000..f33e3e54 --- /dev/null +++ b/komga/src/main/resources/application-docker.yml @@ -0,0 +1,8 @@ +spring: + profiles: + include: prod + datasource: + url: jdbc:h2:/config/database.h2;DB_CLOSE_DELAY=-1 +komga: + root-folder: /books + root-folder-scan-cron: "0 */15 * * * ?" From cbaa3a06c19192036e1b5ed66c095e329b1f4d57 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 27 Aug 2019 21:44:25 +0800 Subject: [PATCH 2/2] gradle tasks to push docker tags --- komga/build.gradle.kts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/komga/build.gradle.kts b/komga/build.gradle.kts index 92d998d2..32ba7d6a 100644 --- a/komga/build.gradle.kts +++ b/komga/build.gradle.kts @@ -105,7 +105,10 @@ tasks { } configure { - name = "gotson/komga:latest" + name = "gotson/komga" + tag("latest", "$name:latest") + tag("semVer", "$name:$version") + tag("beta", "$name:beta") copySpec.from(tasks.getByName("unpack").outputs).into("dependency") buildArgs(mapOf("DEPENDENCY" to "dependency")) dependsOn(tasks.getByName("clean"), tasks.getByName("test"))