FROM maven:3.6.0-alpine

RUN apk add ca-certificates && \
    apk add tzdata && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone

# make source folder
RUN mkdir -p /usr/app
WORKDIR /usr/app
# install maven dependency packages (keep in image)

COPY data-parent /usr/app/data-parent
COPY data-common /usr/app/data-common
COPY data-base /usr/app/data-base
COPY data-mid /usr/app/data-mid
COPY data-show /usr/app/data-show

RUN cd /usr/app/data-parent && mvn -T 1C install  -pl ../data-mid/mid-duration-stock -am

#指定容器启动程序及参数   <ENTRYPOINT> "<CMD>"
EXPOSE 8080
ENTRYPOINT ["java","-Xms200m","-Xmx200m","-jar","/usr/app/data-mid/mid-duration-stock/target/mid-duration-stock-1.0-SNAPSHOT.jar"]