diff --git a/.gitea/workflows/build-push.yaml b/.gitea/workflows/build-push.yaml index 7d1f10e..bc72a9a 100644 --- a/.gitea/workflows/build-push.yaml +++ b/.gitea/workflows/build-push.yaml @@ -11,10 +11,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log in to Gitea Docker Registry uses: docker/login-action@v3 diff --git a/Dockerfile b/Dockerfile index 6714865..1b2fc67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN \ && apt update \ && apt install -y build-essential \ && apt install -y tzdata \ - && apt install -y libghc-zeromq4-haskell-dev \ + && apt install -y libzmq3-dev \ && apt install -y libldap-dev \ && apt install -y libsasl2-dev \ && apt install -y imagemagick \ @@ -49,11 +49,10 @@ RUN \ && sed 's/^DEFINES=/DEFINES=-DUSE_FALLOCATE /' \ makefile > Makefile \ && make -f Makefile \ - && make -f Makefile install + && 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/ + && go install github.com/pgaskin/kepubify@latest RUN echo "**** install python3 ****" 1>&2 @@ -66,8 +65,6 @@ RUN python3 -m venv /app \ && pip3 install --no-cache cryptography \ && pip3 install --no-cache ldap3 \ && pip3 install --no-cache flask-ldap3-login \ - && pip3 install --no-cache --upgrade pip setuptools \ - && pip3 install --no-cache --upgrade cython \ && pip3 install --no-cache --upgrade tzdata \ && pip3 install --no-cache --upgrade netifaces-plus @@ -109,6 +106,10 @@ RUN echo "**** build & install calibre-web ****" 1>&2 \ -r requirements.txt \ -r optional-requirements.txt +run echo "**** copy unrar and kepubify to app folder ****" 1>&2 \ + && mv /usr/bin/unrar /app/bin \ + && mv ./root/go/bin/kepubify /app/bin + # ports and volumes EXPOSE 8083 @@ -127,6 +128,25 @@ echo "**** Setting timezone ****" \ RUN mkdir -p /config \ && chown -R ${PUID}:${PGID} /config +FROM debian:trixie-slim AS production + +RUN \ + echo "**** install production packages ****" 1>&2 \ + && apt update \ + && apt install -y tzdata \ + && apt install -y libzmq5 \ + && apt install -y libldap-2.5-0 \ + && apt install -y libsasl2-2 \ + && apt install -y imagemagick \ + && apt install -y bash \ + && apt install -y sudo \ + && apt install -y python3 + + +COPY --from=build /app /app +COPY --from=build /opt / + + USER ${PUID}:${PGID} 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