XuqmGroup-Server/Dockerfile
XuqmGroup 167d403da6 feat(system): 添加系统更新管理和版本控制功能
- 新增私有化部署系统更新API接口(检查更新、选择性更新、重置等)
- 实现版本管理系统,支持平台版本和服务版本对比检查
- 集成Jenkinsfile自动化构建流程,支持多种版本策略
- 添加Docker镜像版本标签管理和自动注入功能
- 实现选择性更新机制,可指定服务进行增量更新
- 完善版本日志记录和更新历史追踪功能
2026-06-11 13:30:41 +08:00

58 行
2.1 KiB
Docker

ARG SERVICE_MODULE=tenant-service
ARG SERVICE_VERSION=0.0.0
FROM --platform=linux/amd64 maven:3.9.9-eclipse-temurin-21 AS build
ARG SERVICE_MODULE
WORKDIR /workspace
# Copy only pom files first — layer cached until any pom.xml changes
COPY pom.xml ./pom.xml
COPY maven-settings.xml ./maven-settings.xml
COPY common/pom.xml ./common/pom.xml
COPY im-sdk/pom.xml ./im-sdk/pom.xml
COPY tenant-service/pom.xml ./tenant-service/pom.xml
COPY im-service/pom.xml ./im-service/pom.xml
COPY push-service/pom.xml ./push-service/pom.xml
COPY update-service/pom.xml ./update-service/pom.xml
COPY demo-service/pom.xml ./demo-service/pom.xml
COPY file-service/pom.xml ./file-service/pom.xml
COPY license-service/pom.xml ./license-service/pom.xml
# Pre-download dependencies using BuildKit cache mount — persisted across builds
RUN --mount=type=cache,target=/root/.m2 \
mvn -s /workspace/maven-settings.xml -pl ${SERVICE_MODULE} -am \
dependency:go-offline -q
# Copy source — invalidates only the compile layer, not the deps layer
COPY common ./common
COPY im-sdk ./im-sdk
COPY tenant-service ./tenant-service
COPY im-service ./im-service
COPY push-service ./push-service
COPY update-service ./update-service
COPY demo-service ./demo-service
COPY file-service ./file-service
COPY license-service ./license-service
RUN --mount=type=cache,target=/root/.m2 \
mvn -s /workspace/maven-settings.xml -pl ${SERVICE_MODULE} -am -DskipTests package
# Use Alpine-based JRE — ~100MB smaller than jammy
FROM --platform=linux/amd64 eclipse-temurin:21-jre-alpine
WORKDIR /app
ARG SERVICE_MODULE
ARG SERVICE_VERSION
LABEL com.xuqm.service="${SERVICE_MODULE}"
LABEL com.xuqm.version="${SERVICE_VERSION}"
# curl is required by update-service (MI store upload uses ProcessBuilder curl to handle
# Expect:100-continue and force HTTP/1.1 for large multipart uploads)
RUN apk add --no-cache curl docker-cli docker-compose
COPY --from=build /workspace/${SERVICE_MODULE}/target/${SERVICE_MODULE}-0.1.0-SNAPSHOT.jar /app/app.jar
COPY VERSION /app/VERSION
RUN echo "${SERVICE_VERSION}" > /app/SERVICE_VERSION
ENTRYPOINT ["java", "-jar", "/app/app.jar"]