FROM maven:3.8.8-eclipse-temurin-8 AS build-stage

WORKDIR /app

COPY . .

RUN mvn -pl agileboot-admin -am package -Dmaven.test.skip=true -B

FROM eclipse-temurin:8-jre

WORKDIR /app

ENV TZ=Asia/Shanghai

COPY --from=build-stage /app/agileboot-admin/target/*.jar /app/app.jar

EXPOSE 8080

ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /app/app.jar"]
