diff --git a/Dockerfile b/Dockerfile index ca8a97198..9f12f8e21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,29 @@ +FROM maven:3.5.2-jdk-8-alpine as builder + +# 添加 Aliyun Maven 镜像 +RUN mkdir -p /root/.m2 +RUN echo ' \ + \ + \ + alimaven \ + aliyun maven \ + http://maven.aliyun.com/nexus/content/groups/public/ \ + central \ + \ + \ +' > /root/.m2/settings.xml +ENV MAVEN_CONFIG=/root/.m2 + +WORKDIR /kkFileView +COPY . . +RUN mvn clean package -DskipTests -Prelease + + FROM keking/kkfileview-base:4.4.0 -ADD server/target/kkFileView-*.tar.gz /opt/ +COPY --from=builder /kkFileView/server/target/kkFileView-*.tar.gz /opt/ +RUN tar -xzf /opt/kkFileView-*.tar.gz -C /opt && rm /opt/kkFileView-*.tar.gz ENV KKFILEVIEW_BIN_FOLDER=/opt/kkFileView-4.4.0-beta/bin ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.4.0-beta/config/application.properties","-jar","/opt/kkFileView-4.4.0-beta/bin/kkFileView-4.4.0-beta.jar"]