FROM java:8u111-jre-alpine

RUN mkdir -p /nightFragrance
RUN mkdir -p /nightFragrance/upload
RUN mkdir -p /nightFragrance/uploadPath
RUN mkdir -p /nightFragrance/logs
RUN mkdir -p /nightFragrance/pay

COPY *.jar  /nightFragrance/nightFragrance-admin.jar

ENV SERVER_PORT=8097
ENV TimeZone=Asia/Shanghai

RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone

EXPOSE ${SERVER_PORT}

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --update ttf-dejavu fontconfig && rm -rf /var/cache/apk/* && mkfontscale && mkfontdir && fc-cache

ENTRYPOINT ["java", "-jar", "/nightFragrance/nightFragrance-admin.jar", "--server.port=8097"]
