-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from PBH-BTN/master
v6.1.0
- Loading branch information
Showing
105 changed files
with
2,650 additions
and
1,806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
FROM --platform=$BUILDPLATFORM docker.io/maven:3.9.9-eclipse-temurin-21-alpine AS build | ||
# 构建前端 | ||
FROM --platform=$BUILDPLATFORM docker.io/node:alpine AS frontend-build | ||
COPY ./webui /build/webui | ||
WORKDIR /build/webui | ||
RUN corepack enable pnpm && \ | ||
pnpm i && \ | ||
pnpm run build | ||
|
||
# 下载依赖 | ||
FROM maven:3-eclipse-temurin-21-alpine as backend-build | ||
COPY pom.xml /build/pom.xml | ||
WORKDIR /build | ||
# fetch all dependencies | ||
RUN mvn dependency:go-offline -B -T 1.5C -Daether.dependencyCollector.impl=bf -Dmaven.artifact.threads=32 | ||
|
||
# 构建后端 | ||
COPY . /build | ||
WORKDIR /build | ||
RUN apk add --update npm curl && \ | ||
curl -L https://unpkg.com/@pnpm/self-installer | node && \ | ||
cd webui && \ | ||
pnpm i && \ | ||
npm run build && \ | ||
cd .. && \ | ||
mv webui/dist src/main/resources/static && \ | ||
mvn -B clean package --file pom.xml -T 1.5C | ||
# 把前端打包好的文件拉来 | ||
COPY --from=frontend-build /build/webui/dist src/main/resources/static | ||
RUN apk add --update curl git && \ | ||
mvn -B clean package --file pom.xml -T 1.5C -Daether.dependencyCollector.impl=bf -Dmaven.artifact.threads=32 | ||
|
||
# 最终阶段,只要成品 | ||
FROM docker.io/azul/zulu-openjdk-alpine:21.0.4-21.36-jre | ||
LABEL maintainer="https://github.com/PBH-BTN/PeerBanHelper" | ||
USER 0 | ||
ENV TZ=UTC | ||
WORKDIR /app | ||
VOLUME /tmp | ||
COPY --from=build build/target/PeerBanHelper.jar /app/PeerBanHelper.jar | ||
COPY --from=backend-build build/target/PeerBanHelper.jar /app/PeerBanHelper.jar | ||
ENV PATH="${JAVA_HOME}/bin:${PATH}" | ||
ENTRYPOINT ["java","-Xmx386M","-XX:+UseG1GC", "-XX:+UseStringDeduplication","-XX:+ShrinkHeapInSteps","-jar","PeerBanHelper.jar"] |
Oops, something went wrong.