Dockerfile 1006 B

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