Files
booklore/Dockerfile
Balázs Szücs 108d94c0f7 feat(api, build): Upgrade to Java 25, Gradle 9, and Spring Boot 4, Jackson 3 (#2597)
* refactor: simplify RestTemplate and ObjectMapper configurations, add no-args constructors to progress classes

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* chore: update Gradle and Java versions in Docker configuration and build files

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* test: enhance header assertions in tests and add spring-boot-test-autoconfigure dependency

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(tests): migrate to SpringBootTest and update entity management in test cases

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* test: update test property configurations for H2 database in Healthcheck and BookOpds repository tests

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* test: clean up HealthcheckControllerTest by removing unnecessary whitespace and comments

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* test: remove unnecessary whitespace in HealthcheckControllerTest

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* chore: downgrade Flyway version from 12.0.0 to 11.14.1 in build.gradle

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* chore: downgrade Flyway version from 12.0.0 to 11.14.1 in build.gradle

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add @DependsOn annotation for Flyway in MultipartConfig

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add @DependsOn annotation for Flyway in LibraryService

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add test configuration for Flyway in HealthcheckControllerTest
chore: remove unused path variable in deleteLibrary method of LibraryService

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: configure Flyway migration and update test configuration

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: enable remote debugging in bootRun configuration

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: update Flyway version and enhance ObjectMapper configuration

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: remove @DependsOn annotation for Flyway in MultipartConfig and LibraryService

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add NoArgsConstructor and AllArgsConstructor annotations to DTO classes

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add NoArgsConstructor and AllArgsConstructor annotations to FileProcessResult, MetadataUpdateContext, and MetadataUpdateWrapper classes

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add DependsOnDatabaseInitialization annotation to MultipartConfig, AppSettingService, LibraryService, and JwtSecretService classes

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add DependsOnDatabaseInitialization annotation to MultipartConfig and CronService classes

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: implement lazy initialization and thread safety for JWT secret retrieval

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add Flyway dependency and update LibraryService initialization to use ApplicationReadyEvent

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor: remove outdated comments from JwtSecretService class

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor: migrate from com.fasterxml.jackson to tools.jackson for JSON processing

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor: remove unused ObjectMapper bean and related imports from JacksonConfig

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: configure async support with VirtualThreadTaskExecutor in WebMvcConfig

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: enhance application performance with virtual threads and HTTP/2 support

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add JsonSetter annotation to skip null values for triggeredByCron field

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: add triggeredByCron field to TaskCreateRequest and initialize in task management

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat: enable Spring Data web support with DTO serialization in WebMvcConfig

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(UserDefaultsService): simplify class structure and remove unused methods

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(BookOpdsRepositoryDataJpaTest): simplify test setup and use TestEntityManager

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(BookOpdsRepositoryDataJpaTest): update test configuration and simplify entity persistence

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor: update Jackson dependencies and migrate to Jackson 3

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(build.gradle): update jackson-annotations dependency to use Jackson 3 BOM

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(BookOpdsRepositoryDataJpaTest): remove unused ObjectMapper bean definition

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(LibraryService): simplify library deletion logic

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

---------

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-02-08 10:15:16 -07:00

67 lines
2.4 KiB
Docker

# Stage 1: Build the Angular app
FROM node:22-alpine AS angular-build
WORKDIR /angular-app
COPY ./booklore-ui/package.json ./booklore-ui/package-lock.json ./
RUN --mount=type=cache,target=/root/.npm \
npm config set registry http://registry.npmjs.org/ \
&& npm ci --force
COPY ./booklore-ui /angular-app/
RUN npm run build --configuration=production
# Stage 2: Build the Spring Boot app with Gradle
FROM gradle:9.3.1-jdk25-alpine AS springboot-build
WORKDIR /springboot-app
# Copy only build files first to cache dependencies
COPY ./booklore-api/build.gradle ./booklore-api/settings.gradle /springboot-app/
# Download dependencies (cached layer)
RUN --mount=type=cache,target=/home/gradle/.gradle \
gradle dependencies --no-daemon
COPY ./booklore-api/src /springboot-app/src
# Inject version into application.yaml using yq
ARG APP_VERSION
RUN apk add --no-cache yq && \
yq eval '.app.version = strenv(APP_VERSION)' -i /springboot-app/src/main/resources/application.yaml
RUN --mount=type=cache,target=/home/gradle/.gradle \
gradle clean build -x test --no-daemon --parallel
# Stage 3: Final image
FROM eclipse-temurin:25-jre-alpine
ARG APP_VERSION
ARG APP_REVISION
# Set OCI labels
LABEL org.opencontainers.image.title="BookLore" \
org.opencontainers.image.description="BookLore: A self-hosted, multi-user digital library with smart shelves, auto metadata, Kobo & KOReader sync, BookDrop imports, OPDS support, and a built-in reader for EPUB, PDF, and comics." \
org.opencontainers.image.source="https://github.com/booklore-app/booklore" \
org.opencontainers.image.url="https://github.com/booklore-app/booklore" \
org.opencontainers.image.documentation="https://booklore.org/docs/getting-started" \
org.opencontainers.image.version=$APP_VERSION \
org.opencontainers.image.revision=$APP_REVISION \
org.opencontainers.image.licenses="GPL-3.0" \
org.opencontainers.image.base.name="docker.io/library/eclipse-temurin:25-jre-alpine"
ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+UseStringDeduplication -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0"
RUN apk update && apk add nginx gettext su-exec
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY --from=angular-build /angular-app/dist/booklore/browser /usr/share/nginx/html
COPY --from=springboot-build /springboot-app/build/libs/booklore-api-0.0.1-SNAPSHOT.jar /app/app.jar
COPY start.sh /start.sh
RUN chmod +x /start.sh
EXPOSE 8080 80
CMD ["/start.sh"]