mirror of
https://github.com/halo-dev/halo.git
synced 2025-12-20 16:44:38 +08:00
#### What type of PR is this? /kind improvement /area core /milestone 2.20.x #### What this PR does / why we need it: This PR enables Virtual Thread for instances running on JVM 21. This won't affect instances running on JVM 17. References: - https://spring.io/blog/2023/10/31/what-new-is-coming-in-reactor-core-3-6-0 - https://spring.io/blog/2022/10/11/embracing-virtual-threads - https://docs.spring.io/spring-boot/3.4/reference/features/task-execution-and-scheduling.html #### Does this PR introduce a user-facing change? ```release-note None ```
29 lines
989 B
Docker
29 lines
989 B
Docker
FROM eclipse-temurin:21-jre as builder
|
|
|
|
WORKDIR application
|
|
ARG JAR_FILE=application/build/libs/*.jar
|
|
COPY ${JAR_FILE} application.jar
|
|
RUN java -Djarmode=layertools -jar application.jar extract
|
|
|
|
################################
|
|
|
|
FROM ibm-semeru-runtimes:open-21-jre
|
|
LABEL maintainer="johnniang <johnniang@foxmail.com>"
|
|
WORKDIR application
|
|
COPY --from=builder application/dependencies/ ./
|
|
COPY --from=builder application/spring-boot-loader/ ./
|
|
COPY --from=builder application/snapshot-dependencies/ ./
|
|
COPY --from=builder application/application/ ./
|
|
|
|
ENV JVM_OPTS="-Xmx256m -Xms256m" \
|
|
HALO_WORK_DIR="/root/.halo2" \
|
|
SPRING_CONFIG_LOCATION="optional:classpath:/;optional:file:/root/.halo2/" \
|
|
TZ=Asia/Shanghai
|
|
|
|
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
|
|
&& echo $TZ > /etc/timezone
|
|
|
|
Expose 8090
|
|
|
|
ENTRYPOINT ["sh", "-c", "java -Dreactor.schedulers.defaultBoundedElasticOnVirtualThreads=true ${JVM_OPTS} org.springframework.boot.loader.launch.JarLauncher ${0} ${@}"]
|