build(deploy): Add configurable Maven mirror

Add MAVEN_MIRROR_URL for 1Panel backend builds so deployments can
use a faster regional mirror or Maven Central based on network access.

Update the 1Panel deployment guide to document the mirror option and
keep first-time Nacos credentials guidance near environment setup.
This commit is contained in:
Toys-A
2026-08-05 20:44:43 +08:00
parent c91b9059dd
commit 53e309026f
4 changed files with 59 additions and 1 deletions
+18 -1
View File
@@ -7,7 +7,24 @@ WORKDIR /workspace
COPY . .
ARG MODULE
RUN mvn -pl "${MODULE}" -am package -Dmaven.test.skip=true
ARG MAVEN_MIRROR_URL=https://maven.aliyun.com/repository/public
RUN mkdir -p /root/.m2 && cat > /root/.m2/settings.xml <<EOF
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<mirrors>
<mirror>
<id>mirror</id>
<mirrorOf>*</mirrorOf>
<name>mirror</name>
<url>${MAVEN_MIRROR_URL}</url>
</mirror>
</mirrors>
</settings>
EOF
RUN mvn -s /root/.m2/settings.xml -pl "${MODULE}" -am package -Dmaven.test.skip=true
FROM eclipse-temurin:17-jre