diff --git a/Dockerfile b/Dockerfile index 9776db8..d4165e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ FROM maven:3.9-eclipse-temurin-17 AS build WORKDIR /app +# 配置 Maven 使用阿里云镜像源 +COPY settings.xml /usr/share/maven/conf/settings.xml + # 复制项目源码 COPY . . diff --git a/Dockerfile.gateway b/Dockerfile.gateway index c501fc0..3af3106 100644 --- a/Dockerfile.gateway +++ b/Dockerfile.gateway @@ -2,6 +2,9 @@ FROM maven:3.9-eclipse-temurin-17 AS build WORKDIR /app +# 配置 Maven 使用阿里云镜像源 +COPY settings.xml /usr/share/maven/conf/settings.xml + # 复制项目源码 COPY . . diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000..4f207ef --- /dev/null +++ b/settings.xml @@ -0,0 +1,21 @@ + + + + + + + aliyunmaven + central + 阿里云公共仓库 + https://maven.aliyun.com/repository/public + + + + + /root/.m2/repository + + +