FROM fywlsoft.cn:57802/library/alpine-java:8u202b08_server-jre_unlimited

ARG JAR_FILE
COPY ${JAR_FILE} app.jar

COPY docker-entrypoint.sh /usr/share/app/docker-entrypoint.sh
RUN chmod +x /usr/share/app/docker-entrypoint.sh

ENV MYSQL_URL tcp://mysql:3306
ENV WAIT_MYSQL_TIMEOUT 30s

ENV JAVA_OPTIONS "-Xms256m -Xmx512m -Dfile.encoding=UTF-8"
ENV OVERRIDE_PROP ""

ENTRYPOINT ["/usr/share/app/docker-entrypoint.sh"]

EXPOSE 80

HEALTHCHECK --timeout=5s --start-period=60s \
  CMD curl -f http://localhost:8080/actuator/health || exit 1
