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-api /usr/app/data-api

RUN mvn package -DskipTests -f /usr/app/data-api/pom.xml

#指定容器启动程序及参数   <ENTRYPOINT> "<CMD>"
EXPOSE 8080
ENTRYPOINT ["java","-Xms30m","-Xmx250m","-jar","/usr/app/data-api/target/data-api-1.0.0-SNAPSHOT.jar"]