Update Dockerfile to Alpine 3.22 and add Calibre

Bump base image and community repository to Alpine 3.22. Add Calibre and related package fixes to the installed packages. Improve comments and update package installation commands for clarity.
This commit is contained in:
Ludy87 2025-11-13 11:26:08 +01:00
parent 8d18e7dcd0
commit eb6b86160a
No known key found for this signature in database
GPG Key ID: 92696155E0220F94
2 changed files with 13 additions and 11 deletions

View File

@ -267,8 +267,7 @@ jobs:
test-build-docker-images:
if: (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') && needs.files-changed.outputs.docker == 'true'
# needs: [files-changed, build] # tmp disable
needs: [files-changed]
needs: [files-changed, build, docker-compose-tests] # tmp disable
runs-on: ubuntu-latest
strategy:
fail-fast: false

View File

@ -21,14 +21,14 @@ ENV DISABLE_ADDITIONAL_FEATURES=false STIRLING_PDF_DESKTOP_UI=false
RUN ./gradlew clean build -x spotlessApply -x spotlessCheck -x test -x sonarqube
# Main stage
FROM alpine:3.20
FROM alpine:3.22
ARG VERSION_TAG
# Community-Repo aktivieren
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.20/community" >> /etc/apk/repositories
# Enable community repository
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.22/community" >> /etc/apk/repositories
# Alle Pakete in einem RUN
# Install all packages in one RUN command
RUN --mount=type=cache,target=/var/cache/apk \
apk upgrade --no-cache && \
apk add --no-cache \
@ -43,7 +43,7 @@ RUN --mount=type=cache,target=/var/cache/apk \
openssl-dev \
openjdk21-jre \
ffmpeg \
# Doc conversion
# Document conversion
gcompat \
libc6-compat \
libreoffice \
@ -69,7 +69,10 @@ RUN --mount=type=cache,target=/var/cache/apk \
py3-opencv \
ocrmypdf \
py3-pillow \
py3-pdf2image
py3-pdf2image \
# Calibre
calibre && \
apk fix --no-cache calibre
# Python venv + pip packages
RUN set -eux; \
@ -86,8 +89,7 @@ COPY app/core/src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/no
# first /app directory is for the build stage, second is for the final image
COPY --from=build /app/app/core/build/libs/*.jar app.jar
# Verzeichnisse, Fonts, Rechte
# Directories, fonts, permissions
RUN set -eux; \
mv /usr/share/tessdata /usr/share/tessdata-original && \
mkdir -p /home/stirlingpdfuser /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders /tmp/stirling-pdf && \
@ -99,7 +101,7 @@ RUN set -eux; \
/home/stirlingpdfuser /scripts /usr/share/fonts/opentype/noto \
/configs /customFiles /pipeline /tmp/stirling-pdf /app.jar
# Set Environment Variables
# Set environment variables
ENV DISABLE_ADDITIONAL_FEATURES=true \
VERSION_TAG=$VERSION_TAG \
JAVA_BASE_OPTS="-XX:+UnlockExperimentalVMOptions -XX:MaxRAMPercentage=75 -XX:InitiatingHeapOccupancyPercent=20 -XX:+G1PeriodicGCInvokesConcurrent -XX:G1PeriodicGCInterval=10000 -XX:+UseStringDeduplication -XX:G1PeriodicGCSystemLoadThreshold=70" \
@ -120,6 +122,7 @@ ENV DISABLE_ADDITIONAL_FEATURES=true \
TMP=/tmp/stirling-pdf
EXPOSE 8080/tcp
# Set user and run command
ENTRYPOINT ["tini", "--", "/scripts/init.sh"]
CMD ["sh", "-c", "java -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/tmp/stirling-pdf -jar /app.jar & /opt/venv/bin/unoserver --port 2003 --interface 127.0.0.1"]