Files
aiot-platform-cloud/docker/Dockerfile.deps
lzh 3f4b69d532
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
perf: 并行构建 + Maven 依赖缓存优化
主要改进:
1. 并行构建(最大 2 个服务同时构建)
2. Maven 依赖基础镜像(aiot-deps)
3. 服务构建基于依赖镜像,跳过依赖下载
4. 部署也支持并行

预期效果:后续构建时间从 25分钟 降至 8-12分钟
2026-01-13 16:05:24 +08:00

39 lines
1.7 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ============================================
# Maven 依赖基础镜像
# 预下载所有依赖,供服务构建时复用
# ============================================
FROM eclipse-temurin:17-jdk-alpine
# 安装 Maven
RUN apk add --no-cache maven
WORKDIR /build
# 复制所有 pom 文件
COPY pom.xml .
COPY viewsh-dependencies/pom.xml viewsh-dependencies/
COPY viewsh-framework/pom.xml viewsh-framework/
COPY viewsh-gateway/pom.xml viewsh-gateway/
COPY viewsh-server/pom.xml viewsh-server/
COPY viewsh-module-system/pom.xml viewsh-module-system/
COPY viewsh-module-system/viewsh-module-system-api/pom.xml viewsh-module-system/viewsh-module-system-api/
COPY viewsh-module-system/viewsh-module-system-server/pom.xml viewsh-module-system/viewsh-module-system-server/
COPY viewsh-module-infra/pom.xml viewsh-module-infra/
COPY viewsh-module-infra/viewsh-module-infra-api/pom.xml viewsh-module-infra/viewsh-module-infra-api/
COPY viewsh-module-infra/viewsh-module-infra-server/pom.xml viewsh-module-infra/viewsh-module-infra-server/
COPY viewsh-module-iot/pom.xml viewsh-module-iot/
COPY viewsh-module-iot/viewsh-module-iot-core/pom.xml viewsh-module-iot/viewsh-module-iot-core/
COPY viewsh-module-iot/viewsh-module-iot-api/pom.xml viewsh-module-iot/viewsh-module-iot-api/
COPY viewsh-module-iot/viewsh-module-iot-server/pom.xml viewsh-module-iot/viewsh-module-iot-server/
COPY viewsh-module-iot/viewsh-module-iot-gateway/pom.xml viewsh-module-iot/viewsh-module-iot-gateway/
# 下载所有依赖到本地仓库
RUN mvn dependency:go-offline -B || true
# 复制源代码
COPY . .
# 预编译 framework 和 dependencies所有服务共享
RUN mvn install -pl viewsh-dependencies,viewsh-framework -am -DskipTests -B -q || true