Dockerfile 1.0 KB

12345678910111213141516171819202122
  1. FROM registry.sdsys.ru/build-image:alpine-3.10-1 as build
  2. ARG branch=release
  3. ARG gradle_version=5.2.1
  4. COPY id_rsa /root/.ssh
  5. RUN gradle -v \
  6. && printf "Host git.alfatell.ru \n\tStrictHostKeyChecking no" > /root/.ssh/config \
  7. && git clone ssh://gitolite@git.alfatell.ru:2223/web-registration-cloud.git \
  8. && cd web-registration-cloud && git checkout ${branch} \
  9. && echo $(git log -p -1 --pretty=format:"%h"|head -n1) > /tmp/version && cd customer-api \
  10. && mvn clean install && cd ../promo/ \
  11. && figlet -c Building Promo \
  12. && gradle tasks bootWar \
  13. && rm -rf /root/.ssh/id_rsa
  14. FROM registry.sdsys.ru/iru/iru-base:7.6
  15. ARG DB_CLUSTER=mongodb1:27017,mongodb2:27018,mongodb3:27019
  16. ARG SERVER_PORT=9000
  17. HEALTHCHECK --start-period=30s --interval=15s --timeout=5s --retries=2 CMD curl -f 127.0.0.1:${SERVER_PORT} || exit 1
  18. COPY --from=build /web-registration-cloud/promo/build/libs/promo-0.0.1-SNAPSHOT.war /opt/
  19. COPY --from=build /tmp/version /tmp/
  20. CMD ["java", "-jar", "/opt/promo-0.0.1-SNAPSHOT.war"]