1. FROM openjdk:8-jre-alpine
    2. ENV DJ_SLEEP 0
    3. ENV PROFILE dev
    4. # 替换阿里云的源
    5. RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
    6. # 更新源、同步时间
    7. RUN apk update \
    8. && apk add ca-certificates \
    9. && apk add --no-cache tzdata \
    10. && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    11. && date
    12. # add directly the war
    13. ADD *.war /app.war
    14. RUN sh -c 'touch /app.war'
    15. VOLUME /tmp
    16. EXPOSE 80
    17. CMD echo "The application will start in ${DJ_SLEEP}s..." && \
    18. sleep ${DJ_SLEEP} && \
    19. java -Xmx4096m -jar -Ddefault.client.encoding="UTF-8" -Dfile.encoding="UTF-8" -Duser.language="Zh" -Duser.region="CN" app.war --spring.profiles.active=${PROFILE}