From 1d1e3fdb663e0f74aedaa7e0bf25aafa2ffdbc3e Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Thu, 19 Sep 2024 15:54:35 +0800 Subject: [PATCH] feat(docker): bundle kepubify --- komga/docker/Dockerfile.tpl | 16 +++++++++++++--- komga/src/main/resources/application-docker.yml | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 komga/src/main/resources/application-docker.yml diff --git a/komga/docker/Dockerfile.tpl b/komga/docker/Dockerfile.tpl index 46aeecf1..6541d1dd 100644 --- a/komga/docker/Dockerfile.tpl +++ b/komga/docker/Dockerfile.tpl @@ -18,6 +18,8 @@ RUN apt -y update && \ wget "https://github.com/libjxl/libjxl/releases/download/v0.8.2/jxl-debs-amd64-ubuntu-22.04-v0.8.2.tar.gz" && \ tar -xzf jxl-debs-amd64-ubuntu-22.04-v0.8.2.tar.gz && \ apt -y install ./jxl_0.8.2_amd64.deb ./libjxl_0.8.2_amd64.deb ./libjxl-dev_0.8.2_amd64.deb && \ + wget "https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-64bit" -O /usr/bin/kepubify && \ + chmod +x /usr/bin/kepubify && \ rm *.deb && rm *.ddeb && rm jxl-debs-amd64-ubuntu-22.04-v0.8.2.tar.gz && \ apt -y remove wget software-properties-common && apt -y autoremove && rm -rf /var/lib/apt/lists/* ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu" @@ -28,13 +30,21 @@ ENV JAVA_HOME=/opt/java/openjdk COPY --from=eclipse-temurin:21-jre $JAVA_HOME $JAVA_HOME ENV PATH="${JAVA_HOME}/bin:${PATH}" RUN apt -y update && \ - apt -y install ca-certificates locales libheif-dev libwebp-dev libarchive-dev && \ + apt -y install ca-certificates locales libheif-dev libwebp-dev libarchive-dev wget && \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \ - locale-gen en_US.UTF-8 + locale-gen en_US.UTF-8 && \ + wget "https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-arm64" -O /usr/bin/kepubify && \ + chmod +x /usr/bin/kepubify && \ + apt -y remove wget && apt -y autoremove && rm -rf /var/lib/apt/lists/* ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/aarch64-linux-gnu" # arm builder: uses temurin-17, as arm32 support was dropped in JDK 21 FROM eclipse-temurin:17-jre as build-arm +RUN apt -y update && \ + apt -y install wget && \ + wget "https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-arm" -O /usr/bin/kepubify && \ + chmod +x /usr/bin/kepubify && \ + apt -y remove wget && apt -y autoremove && rm -rf /var/lib/apt/lists/* FROM build-${TARGETARCH} AS runner VOLUME /tmp @@ -46,6 +56,6 @@ COPY --from=builder snapshot-dependencies/ ./ COPY --from=builder application/ ./ ENV KOMGA_CONFIGDIR="/config" ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -ENTRYPOINT ["java", "--enable-preview", "--enable-native-access=ALL-UNNAMED", "org.springframework.boot.loader.launch.JarLauncher", "--spring.config.additional-location=file:/config/"] +ENTRYPOINT ["java", "-Dspring.profiles.include=docker", "--enable-preview", "--enable-native-access=ALL-UNNAMED", "org.springframework.boot.loader.launch.JarLauncher", "--spring.config.additional-location=file:/config/"] EXPOSE 25600 LABEL org.opencontainers.image.source="https://github.com/gotson/komga" diff --git a/komga/src/main/resources/application-docker.yml b/komga/src/main/resources/application-docker.yml new file mode 100644 index 00000000..ffac7ce9 --- /dev/null +++ b/komga/src/main/resources/application-docker.yml @@ -0,0 +1,2 @@ +komga: + kobo.kepubify-path: /usr/bin/kepubify