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