Dockerfile-promo-seo 1.2 KB

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