Dockerfile 876 B

12345678910111213141516171819202122232425262728
  1. FROM openjdk:8-jdk-alpine
  2. MAINTAINER iamsee "root@iamsee.com"
  3. # The environment variable
  4. ENV APP_NAME="railway-admin"
  5. ENV APP_VERSION=""
  6. ENV JAVA_OPTS=""
  7. ENV SPRINGBOOT_OPTS="--spring.profiles.active=docker -Ddruid.mysql.usePingMethod=false"
  8. RUN #apk add --update ttf-dejavu fontconfig
  9. RUN echo -e "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.13/main\n\
  10. https://mirror.tuna.tsinghua.edu.cn/alpine/v3.13/community" > /etc/apk/repositories
  11. RUN apk --update add tzdata && \
  12. cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
  13. echo "Asia/Shanghai" > /etc/timezone && \
  14. apk del tzdata && \
  15. rm -rf /var/cache/apk/*
  16. RUN apk --update add curl bash ttf-dejavu && \
  17. rm -rf /var/cache/apk/*
  18. EXPOSE 2021
  19. COPY $APP_NAME/target/$APP_NAME.jar /app.jar
  20. ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar $SPRINGBOOT_OPTS