From 4baabb4aa501c97a91ac0d89ad0b09ddf1c34b40 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Fri, 27 Dec 2024 14:11:12 +0100 Subject: [PATCH] Change dockerfile, now bild also on arm64 --- Dockerfile | 47 ++++++++----------- .../calibre-web/optional-requirements.patch | 11 +++++ 2 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 patches/calibre-web/optional-requirements.patch diff --git a/Dockerfile b/Dockerfile index ddbde1a..8e1b6eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,8 @@ RUN \ && apt install -y python3-pip \ && apt install -y python3-venv \ && apt install -y python3-dev \ - && apt install -y python3-setuptools + && apt install -y python3-setuptools \ + && apt install -y golang-go RUN echo "**** create tmp dir ****" 1>&2 \ && mkdir -p /tmp @@ -52,11 +53,18 @@ RUN \ && make -f Makefile \ && make -f Makefile install +RUN echo "***install kepubify from source" 1>&2 \ + && go install github.com/pgaskin/kepubify@latest \ + && mv ./root/go/bin/kepubify /usr/local/bin/ + RUN echo "**** install python3 ****" 1>&2 ENV PYTHONUNBUFFERED=1 RUN python3 -m venv /app \ && . /app/bin/activate \ + && pip3 install --no-cache --upgrade pip \ + && pip3 install --no-cache --upgrade setuptools \ + && pip3 install --no-cache --upgrade poetry \ && pip3 install --no-cache cryptography \ && pip3 install --no-cache ldap3 \ && pip3 install --no-cache flask-ldap3-login \ @@ -70,10 +78,10 @@ COPY patches /tmp/patches RUN echo "**** install calibre ****" 1>&2 \ # install calibre binary -ENV LD_LIBRARY_PATH /usr/lib:/opt/calibre/lib -ENV PATH $PATH:/opt/calibre/bin -ENV LC_ALL C -ENV CALIBRE_INSTALLER https://download.calibre-ebook.com/linux-installer.sh +ENV LD_LIBRARY_PATH=/usr/lib:/opt/calibre/lib +ENV PATH=$PATH:/opt/calibre/bin +ENV LC_ALL=C +ENV CALIBRE_INSTALLER=https://download.calibre-ebook.com/linux-installer.sh RUN apt install -y libopengl0 \ && apt install -y libegl1 \ && apt install -y libxcb-cursor0 \ @@ -88,36 +96,21 @@ RUN echo "**** download calibre-web ****" 1>&2 \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi \ && echo " ---> install version ${CALIBREWEB_RELEASE}" 1>&2 \ - && git clone --depth 1 --branch ${CALIBREWEB_RELEASE} https://github.com/janeczku/calibre-web.git /tmp/calibreweb \ - && cd /tmp/calibreweb \ - && mkdir -p src \ - && ln -s /tmp/calibreweb /tmp/calibreweb/src/calibreweb - + && git clone --depth 1 --branch ${CALIBREWEB_RELEASE} https://github.com/janeczku/calibre-web.git /app/calibreweb RUN echo "**** apply calibre-web patches ****" 1>&2 \ - && cd /tmp/calibreweb/src/calibreweb \ + && cd /app/calibreweb \ && for p in /tmp/patches/calibre-web/* ; do \ patch -p0 < ${p} ; \ done RUN echo "**** build & install calibre-web ****" 1>&2 \ && . /app/bin/activate \ - && cd /tmp/calibreweb/src/calibreweb \ - && pip3 install -U --no-cache-dir \ - -r requirements.txt \ - -r optional-requirements.txt \ - && cd .. \ - && pip3 install /tmp/calibreweb + && cd /app/calibreweb \ + && pip3 install --no-cache \ + -r requirements.txt \ + -r optional-requirements.txt - RUN echo "***install kepubify" 1>&2 && \ - if [ -z ${KEPUBIFY_RELEASE} ]; then \ - KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi \ - && curl -o \ - /usr/bin/kepubify -L \ - https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit \ - && chmod +x /usr/bin/kepubify # ports and volumes EXPOSE 8083 @@ -138,4 +131,4 @@ RUN mkdir -p /config \ USER ${PUID}:${PGID} -CMD /app/bin/python3 /app/lib/python3.12/site-packages/calibreweb/cps.py -p /config/app.db -g /config/gdrive.db -o /config/calibre-web.log \ No newline at end of file +CMD /app/bin/python3 /app/calibreweb/cps.py -p /config/app.db -g /config/gdrive.db -o /config/calibre-web.log \ No newline at end of file diff --git a/patches/calibre-web/optional-requirements.patch b/patches/calibre-web/optional-requirements.patch new file mode 100644 index 0000000..dff4f73 --- /dev/null +++ b/patches/calibre-web/optional-requirements.patch @@ -0,0 +1,11 @@ +*** optional-requirements.txt Fri Dec 27 13:03:56 2024 +--- optional-requirements.txt Fri Dec 27 13:06:30 2024 +*************** +*** 45,47 **** +--- 45,50 ---- + + # Kobo integration + jsonschema>=3.2.0,<4.24.0 ++ ++ # QRCode for MagicLink ++ qrcode>=8.0.0